xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Rockosov <rockosov@gmail.com>
To: Tamas K Lengyel <tamas.k.lengyel@gmail.com>
Cc: Xen-devel <xen-devel@lists.xen.org>
Subject: Re: HVMOP_altp2m_vcpu_enable_notify code example usage
Date: Mon, 22 Aug 2016 18:09:46 +0300	[thread overview]
Message-ID: <CAKkXUyrp3uOY_zfxDgPiEEvJkx78i_AF7H92kFJVCkxOCrBLDw@mail.gmail.com> (raw)
In-Reply-To: <CABfawh=kd0xuV65bRK8xL=XYDa75DMay8voi=vytiLk_Fus-Uw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2714 bytes --]

Hello Tamas,

Thank you for the answer!

I installed the same xen source code (4.7.0) as on dom0 to domU, built
dist-tools, installed xen-tools, updated rc.d configuration and rebooted.
IOCTL channel to privcmd driver is working fine, but all requests to
hypervisor like hvm_get_param, translate_foreign_address,
altp2m_vcpu_enable_notify return EFAULT errno (Bad access).

Just for experiment I wrote below code in usermode:
===================================
...
rc = xc_hvm_param_get(xch, DOMID_SELF, HVM_PARAM_CONSOLE_PFN, &value);
if (rc < 0) {
    PERROR("Fail to get CONSOLE PFN HVM PARAM\n");
    goto exit;
}
DPRINTF("CONSOLE PFN == %llx", (unsigned long long)value);
...
===================================

and below code in kernelmode:
===================================
...
printk(KERN_INFO "We are in Xen domain HVM = %d\n", xen_hvm_domain());
err = hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &value);
printk(KERN_INFO "err = %d\n", err);
printk(KERN_INFO "CONSOLE PFN = %llx\n", value);
...
===================================

In the usermode I got an error:
===================================
Fail to get CONSOLE PFN HVM PARAM
: Bad address
===================================

In the kernelmode code executed fine:
===================================
[23261.230188] We are in Xen domain HVM = 1
[23261.307840] err = 0
[23261.352587] CONSOLE PFN = fefff
===================================

Looks like usermode wrappers don't support many requests to hypervisor,
right?

Best Regards,
Rockosov Dmitry

2016-08-21 20:27 GMT+03:00 Tamas K Lengyel <tamas.k.lengyel@gmail.com>:

> Hi Dmitry,
> as long as you are testing with a HVM Linux guest you should be able
> to just compile the Xen tools in the guest and then use libxc from
> within the guest to issue that hypercall via
> xc_altp2m_set_vcpu_enable_notify. You will need to load a couple Xen
> related kernel-modules for it to work (like xen-privcmd). Let us know
> if you got it working!
>
> Cheers,
> Tamas
>
> On Fri, Aug 19, 2016 at 1:19 PM, Dmitry Rockosov <rockosov@gmail.com>
> wrote:
> > Hello Xen Team!
> >
> > Does anybody have any code examples of HVMOP_altp2m_vcpu_enable_notify?
> >
> > I want to fully test #VE, VMFUNC and EPTP Switching VM Function 0 in Xen,
> > but doesn't have any documentations/examples for it.
> > I tried xen-access test from tools/tests/xen-access, but looks like it
> > doesn't use VMFUNC and #VE, it simply changes VMCS entries with vmwrite,
> w/o
> > VMFUNC 0 (EPTP Switching).
> >
> > Thanks in advance!
> >
> > Best Regards,
> > Rockosov Dmitry
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > https://lists.xen.org/xen-devel
> >
>

[-- Attachment #1.2: Type: text/html, Size: 4861 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-22 15:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19 19:19 HVMOP_altp2m_vcpu_enable_notify code example usage Dmitry Rockosov
2016-08-21 17:27 ` Tamas K Lengyel
2016-08-22 15:09   ` Dmitry Rockosov [this message]
2016-08-22 18:12     ` Dmitry Rockosov
2016-08-22 18:28       ` Tamas K Lengyel
2016-08-22 18:42         ` Dmitry Rockosov
2016-08-22 18:54           ` Tamas K Lengyel
2016-08-22 19:08             ` Dmitry Rockosov

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=CAKkXUyrp3uOY_zfxDgPiEEvJkx78i_AF7H92kFJVCkxOCrBLDw@mail.gmail.com \
    --to=rockosov@gmail.com \
    --cc=tamas.k.lengyel@gmail.com \
    --cc=xen-devel@lists.xen.org \
    /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).