[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: HVM hypercalls



I am running 2.6.30 (downloaded from kernel.org) on top of CENTOS 5.4.
Do u mean i should enable following option

--> Processor type and features
 [*] Paravirtualized guest support --->
     Â --> [ ] Xen guest support (NEW)

But enabling this also selects PARAVIRT and does it make my guest PV guest or PVHVM guest?

--- Paravirtualized guest support
[*]ÂÂ Xen guest support
(32)ÂÂÂ Maximum allowed size of a domain in gigabytes (NEW)
[ ]ÂÂÂÂ Enable Xen debug and tuning parameters in debugfs
[ ]ÂÂ KVM paravirtualized clock (NEW)
[ ]ÂÂ KVM Guest support (NEW)
-*-ÂÂ Enable paravirtualization code
[ ]ÂÂÂÂ Paravirtualization layer for spinlocks

Could you please suggest how to enable only PVHVM support? I am fine for moving to recent kernels if required.

Thanks & Regards,
VSR.

On Tue, May 24, 2011 at 5:38 PM, Ian Campbell-12 [via Xen] <[hidden email]> wrote:
On Mon, 2011-05-23 at 14:52 +0100, veerasena reddy wrote:

> Hi,
>
> Thanks a lot for quick reply.
>
> I modified my code to get physical page address and now i do not see
> error message on XEN hypervisor.
> Could you please correct if am writing proper physical address or not?
>
> We can write the page address to hypervisor using wrmsr() but who
> should set hypercall_page which is declared as extern in hypercall.h
> on HVM? Because when i try to invoke HYPERCALL_xxxx(), it reported
> hypercall_page not declared. Do we need to enable CONFIG_XEN in HVM
> kernel in order to invoke hypercalls to hypervisor?
Which kernel are you running with?

This should all be taken care of for you in a kernel with PVHVM support
enabled.

> Could you please share any sample code if you have to get a clear
> understanding of HVM hypercalls.
>
> {
> Â Â Â Â char id[13];
> Â Â Â Â unsigned int msr1;
> Â Â Â Â unsigned long Âmy_hpage_phys;
> Â Â Â Â int my_hpage_lo, my_hpage_hi;
>
> Â Â Â Â __asm__ __volatile__(
> Â Â Â Â Â Â Â Â "cpuid"
> Â Â Â Â Â Â Â Â : "=b" (*(int *)(&id[0])),
> Â Â Â Â Â Â Â Â Â "=d" (*(int *)(&id[8])),
> Â Â Â Â Â Â Â Â Â "=c" (*(int *)(&id[4]))
> Â Â Â Â Â Â Â Â : "a" (0x40000000)
> Â Â Â Â );
> Â Â Â Â id[12]='\0';
> Â Â Â Â printk("CPU ID read- %s\n", id);
>
> Â Â Â Â /* Read MSR register */
> Â Â Â Â __asm__ __volatile__(
> Â Â Â Â Â Â Â Â "cpuid"
> Â Â Â Â Â Â Â Â : "=b" (*(int *)(&msr1))
> Â Â Â Â Â Â Â Â : "a" (0x40000002)
> Â Â Â Â );
>
> Â Â Â Â my_hpage_phys = __get_free_page(GFP_ATOMIC);
> Â Â Â Â hypercall_page = virt_to_phys(my_hpage_phys);
> Â Â Â Â printk("my_hpage_phys get_free = %lx\n", my_hpage_phys);
> Â Â Â Â printk("hypercal_page = %p\n", hypercall_page);
>
> Â Â Â Â my_hpage_lo = (unsigned long)hypercall_page & 0xffffffff;
> Â Â Â Â my_hpage_hi = (unsigned long)hypercall_page >> 32;
> Â Â Â Â printk("my_hpage lo = %x hi = %x\n", my_hpage_lo,
> my_hpage_hi);
> Â Â Â Â /* Write hypercall page address to MSR */
> Â Â Â Â wrmsr(msr1, my_hpage_lo, my_hpage_hi);
>
> Â Â Â Â return 0;
> }
>
> ================= output on HVM ==========
> [root@localhost src]# dmesg
> my_hypercall_page @ ffffffffa0388000
> CPU ID read- XenVMMXenVMM
> my_hpage_phys get_free = ffff880005c0b000
> hypercal_page = 0000000005c0b000
> my_hpage lo = 5c0b000 hi = 0
> ============================
>
> Thanks & Regards,
> VSR.
>
> On Mon, May 23, 2011 at 1:52 PM, Ian Campbell
> <[hidden email]> wrote:

> Â Â Â Â On Mon, 2011-05-23 at 08:48 +0100, veeruyours wrote:
> Â Â Â Â > Hi,
> Â Â Â Â >
> Â Â Â Â > I recently started working on XEN, and I am looking for ways
> Â Â Â Â to invoke
> Â Â Â Â > hypercalls from HVM.
> Â Â Â Â > I followed your instructions and succeeded in reading MSR
> Â Â Â Â register.
> Â Â Â Â > But when i attempt to write the physical address of a 4K
> Â Â Â Â page from my HVM
> Â Â Â Â > guest (2.6.30 kernel), i observed the XEN hypervisor
> Â Â Â Â reporting it as bad
> Â Â Â Â > GMFN as follows.
> Â Â Â Â >
> Â Â Â Â > [root@f13 ~]# xm dmesg -c
> Â Â Â Â > (XEN) traps.c:664:d17 Bad GMFN ffff88001e925 (MFN
> Â Â Â Â ffffffffffffffff) to MSR
> Â Â Â Â > 40000000
> Â Â Â Â
> Â Â Â Â
> Â Â Â Â That supposed GMFN (fff88001e925) looks an awful lot like a
> Â Â Â Â virtual
> Â Â Â Â address and not a physical one to me, unless your guest really
> Â Â Â Â has >4TB
> Â Â Â Â of RAM assigned...
> Â Â Â Â
> Â Â Â Â
> Â Â Â Â >
> Â Â Â Â > Could you please help me in understanding what went wrong in
> Â Â Â Â my
> Â Â Â Â > implementation.
> Â Â Â Â >
> Â Â Â Â > I am running XEN 4.0.1 on AMD 64bit machine with svm support
> Â Â Â Â and the dom0
> Â Â Â Â > kernel running 2.6.32.39.
> Â Â Â Â >
> Â Â Â Â > The
> Â Â Â Â > Thanks & Regards,
> Â Â Â Â > VSR.
> Â Â Â Â >
> Â Â Â Â >
> Â Â Â Â > --
> Â Â Â Â > View this message in context:
> Â Â Â Â http://xen.1045712.n5.nabble.com/HVM-hypercalls-tp2541346p4418332.html
> Â Â Â Â > Sent from the Xen - Dev mailing list archive at Nabble.com.
> Â Â Â Â >
> Â Â Â Â > _______________________________________________
> Â Â Â Â > Xen-devel mailing list
> Â Â Â Â > [hidden email]
> Â Â Â Â > http://lists.xensource.com/xen-devel
> Â Â Â Â
> Â Â Â Â
> Â Â Â Â
>



_______________________________________________
Xen-devel mailing list
[hidden email]

If you reply to this email, your message will be added to the discussion below:
http://xen.1045712.n5.nabble.com/HVM-hypercalls-tp2541346p4421864.html
To unsubscribe from HVM hypercalls, click here.



View this message in context: Re: HVM hypercalls
Sent from the Xen - Dev mailing list archive at Nabble.com.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.