From: veeruyours <veeruyours@gmail.com>
To: xen-devel@lists.xensource.com
Subject: Re: HVM hypercalls
Date: Tue, 24 May 2011 06:58:35 -0700 (PDT) [thread overview]
Message-ID: <BANLkTikfYN9-TJMnOyV62T7FzAAXqhoH1w@mail.gmail.com> (raw)
In-Reply-To: <1306238808.20576.171.camel@zakaz.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 6157 bytes --]
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] <
ml-node+4421864-1644938153-207502@n5.nabble.com> 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] <http://user/SendEmail.jtp?type=node&node=4421864&i=0>>
> 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://user/SendEmail.jtp?type=node&node=4421864&i=1>
> > > http://lists.xensource.com/xen-devel
> >
> >
> >
> >
>
>
>
> _______________________________________________
> Xen-devel mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=4421864&i=2>
> http://lists.xensource.com/xen-devel
>
>
> ------------------------------
> 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<http://xen.1045712.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2541346&code=dmVlcnV5b3Vyc0BnbWFpbC5jb218MjU0MTM0NnwyMDQ5MTI4OTk2>.
>
>
--
View this message in context: http://xen.1045712.n5.nabble.com/HVM-hypercalls-tp2541346p4422128.html
Sent from the Xen - Dev mailing list archive at Nabble.com.
[-- Attachment #1.2: Type: text/html, Size: 9525 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-05-24 13:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 19:22 HVM hypercalls Ruslan Nikolaev
2010-07-29 1:05 ` Dan Magenheimer
2010-07-29 7:30 ` Juergen Gross
2010-07-29 18:55 ` Ruslan Nikolaev
2010-07-29 19:47 ` Jeremy Fitzhardinge
2010-07-30 16:06 ` Ruslan Nikolaev
2010-07-31 0:07 ` Jeremy Fitzhardinge
2010-08-03 19:48 ` Ruslan Nikolaev
2010-08-03 21:40 ` Jeremy Fitzhardinge
2010-08-04 17:41 ` Ruslan Nikolaev
2010-08-05 7:25 ` Christoph Egger
2010-08-05 10:31 ` Stefano Stabellini
2011-05-23 7:48 ` veeruyours
2011-05-23 8:22 ` Ian Campbell
2011-05-23 13:52 ` veerasena reddy
2011-05-24 12:06 ` Ian Campbell
2011-05-24 13:58 ` veeruyours [this message]
2011-05-24 14:09 ` Ian Campbell
2011-05-25 7:38 ` veeruyours
2011-05-25 8:13 ` Ian Campbell
-- strict thread matches above, loose matches on Subject: below --
2010-08-06 21:58 Ruslan Nikolaev
2010-08-09 9:41 ` Stefano Stabellini
2010-08-03 20:30 Ruslan Nikolaev
2010-08-02 0:32 Ruslan Nikolaev
2008-08-19 14:38 HVM Hypercalls Kumar, Venkat
2008-08-19 14:53 ` Keir Fraser
2008-08-20 11:48 ` Kumar, Venkat
2008-08-20 12:11 ` Keir Fraser
2006-12-15 18:46 HVM hypercalls Ky Srinivasan
2006-12-15 19:54 ` Keir Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTikfYN9-TJMnOyV62T7FzAAXqhoH1w@mail.gmail.com \
--to=veeruyours@gmail.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).