From: Tamas K Lengyel <tamas.k.lengyel@gmail.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: matt@starlab.io, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: Followup: HVMOP_altp2m_vcpu_enable_notify code example usage
Date: Fri, 28 Oct 2016 12:56:25 +0200 [thread overview]
Message-ID: <CABfawhn3_thCFkmr_3mnPXs5QojXYJgh2nsJechY2rKTUo_i4w@mail.gmail.com> (raw)
In-Reply-To: <e7e45a73-8153-e00a-de60-266b8cb05664@citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 1676 bytes --]
On Thu, Oct 27, 2016 at 12:45 AM, Andrew Cooper <andrew.cooper3@citrix.com>
wrote:
> On 26/10/2016 20:37, Matt Leinhos wrote:
> > A while ago there was a thread by the same name in this group (see
> > https://lists.xen.org/archives/html/xen-devel/2016-08/msg02591.html).
> >
> > I've looked through the thread and did not see a resolution: do we have
> > an example handler for #VE - preferably on x86_64? I haven't found such
> > a handler in the xen code or through searches.
> >
> > I am attempting to use the altp2m API from a domU and need to handle #VE.
>
> A #VE handler is only interesting for a domU, knowing it is running
> under an altp2m-capable hypervisor.
>
> The hypervisor itself won't ever receive #VE from real hardware, which
> is why there is no example code in Xen.
>
Well, unless Xen is running in a nested setting ;)
>
> I don't know if there is any public example code, but a #VE handler in
> domU is intended to work very similarly to a plain #PF handler. #VE
> specifically means "there is an EPT translation but the access failed
> for permission reasons, and the guest has elected to handle this fault
> itself". It is then up to the domU kernel to decide what to do; whether
> to terminate the process/thread which cause the violation, or to alter
> the permissions and rerun the instruction.
>
Correct. The guest itself needs to issue the appropriate HVMOP hypercalls
to enable #VE and register the memory location where the trap info should
be stored at. The only caveat is that only permission faults in altp2m view
1-10 will generate a #VE in the domU, view 0 won't (at least when it is
emulated on hw without real #VE support).
Tamas
[-- Attachment #1.2: Type: text/html, Size: 2475 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
prev parent reply other threads:[~2016-10-28 10:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-26 19:37 Followup: HVMOP_altp2m_vcpu_enable_notify code example usage Matt Leinhos
2016-10-26 22:45 ` Andrew Cooper
2016-10-28 10:56 ` Tamas K Lengyel [this message]
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=CABfawhn3_thCFkmr_3mnPXs5QojXYJgh2nsJechY2rKTUo_i4w@mail.gmail.com \
--to=tamas.k.lengyel@gmail.com \
--cc=andrew.cooper3@citrix.com \
--cc=matt@starlab.io \
--cc=xen-devel@lists.xenproject.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).