implemented VTLB infrastructure per domain on XEN/IPF, which tracked guest tlb
information. VTLB has fixed size, then when using out of it, HV will desert all
VTLB and recycle VTLB. We add a flag “lock” in VTLB entry, when HV recycle
VTLB, the VTLB entry with “lock” flag will not be deserted, but if Guest uses
instructions like “ptc” to purge tlb, the VTLB entry with “lock” flag will be
Module pseudo read parameter once per page size to make sure the translation
for this parameter has been inserted in VTLB infrastructure. Then kernel Module
will call another new hypercall which don’t need pointer parameter to lock
above translation in VTLB infrastructure.
invoking this hypercall,
HV will use copy_from_user() or copy_to_user() to get parameter or return
result. In these functions, HV will lookup VTLB infrastructure to get corresponding
guest physical address of the parameter, because this translation has been
locked in VTLB, HV definitely can find it, then HV can get corresponding
machine address from physical to machine address table, as we know HV use
region 7 for identity mapping, HV can get identity virtual address for that
machine address, at last, HV do normal copy operation using this identity
application definitely will unmap the memory allocated for passing hypercall
parameter, and this operation definitely will purge tlb for this address, so
the “lock” VTLB entry in VTLB infrastructure can be recycled.
tested this parameter passing mechanism for several hypercalls, such as GETMEMLIST,
and it works well.
we check in this patch and discuss further?
Magenheimer, Dan (HP Labs Fort Collins) [mailto:dan.magenheimer@xxxxxx]
To: Xu, Anthony
Subject: RE: how to put kernel
module in xen/ipf
Yes, the hypercall
parameter mechanism is still evolving for Xen/ia64. Very few
hypercalls are necessary
to run domain0, so experimentation with different hypercall
mechanisms has waited
until multi-domain work.
Can you explain more
about kernel modules? I know (roughly) how they
work for Linux, but not
how they are used on Xen/x86. Others on this
list might like to learn
too, so perhaps you could explain the design
Xu, Anthony [mailto:anthony.xu@xxxxxxxxx]
Sent: Monday, June 20, 2005 11:10
To: Magenheimer, Dan (HP Labs Fort Collins)
Subject: how to put kernel module
module has a lot of difference from XEN/ia32, especially the mechanism of passing
hypercall parameter. Currently
we create directory “km” under xen/arch/ia64,
and put kernel module code in that directory.