xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Ravi Sahita <ravi.sahita@intel.com>
Cc: Tim Deegan <tim@xen.org>, Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Edmund H White <edmund.h.white@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"tlengyel@novetta.com" <tlengyel@novetta.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH v4 07/15] VMX: add VMFUNC leaf 0 (EPTP switching) to emulator.
Date: Mon, 13 Jul 2015 08:13:34 +0100	[thread overview]
Message-ID: <55A3813E020000780008FF02@mail.emea.novell.com> (raw)
In-Reply-To: <DBC12B0F5509554280826E40BCDEE8BE54FD2FC1@ORSMSX104.amr.corp.intel.com>

>>> On 11.07.15 at 22:01, <ravi.sahita@intel.com> wrote:
>> From: Jan Beulich [mailto:JBeulich@suse.com]
>>Sent: Friday, July 10, 2015 2:31 AM
>>
>>>>> On 10.07.15 at 02:52, <edmund.h.white@intel.com> wrote:
>>> @@ -3234,6 +3256,13 @@ void vmx_vmexit_handler(struct cpu_user_regs
>>*regs)
>>>              update_guest_eip();
>>>          break;
>>>
>>> +    case EXIT_REASON_VMFUNC:
>>> +        if ( vmx_vmfunc_intercept(regs) == X86EMUL_EXCEPTION )
>>> +            hvm_inject_hw_exception(TRAP_invalid_op,
>>HVM_DELIVER_NO_ERROR_CODE);
>>> +        else
>>> +            update_guest_eip();
>>> +        break;
>>
>>How about X86EMUL_UNHANDLEABLE and X86EMUL_RETRY? As said before,
>>either get this right, or simply fold the relatively pointless helper into 
> here.
> 
> Sure I can add the other error conditions but note that they will be handled 
> as EXCEPTION.

The reason for this would need to go into ...

> Let me explain the point of the relatively pointless :-) helper 
> was to have the interface complete so that if someone in the future wanted to 
> handle VMFUNC exits (perhaps for lazily managing EPTP list for nesting 
> scenarios) they could do that by extending the vmx_vmfunc_intercept. I can 
> also add a comment there - Will that be sufficient? (I'm trying to avoid 
> another revision after I revise it to add the other exception conditions as 
> stated)

... such a comment. And yes, I'd be as fine with just a comment as
with the wrapper being folded in.

>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>>> @@ -3816,8 +3816,9 @@ x86_emulate(
>>>          struct segment_register reg;
>>>          unsigned long base, limit, cr0, cr0w;
>>>
>>> -        if ( modrm == 0xdf ) /* invlpga */
>>> +        switch( modrm )
>>>          {
>>> +        case 0xdf: /* invlpga AMD */
>>>              generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1);
>>>              generate_exception_if(!mode_ring0(), EXC_GP, 0);
>>>              fail_if(ops->invlpg == NULL);
>>
>>The diff now looks much better. Yet I don't see why you added "AMD"
>>to the comment - we don't elsewhere note that certain instructions are
>>vendor specific (and really which ones are also changes over time, see RDTSCP
>>for a prominent example).
>>
> 
> I thought it would be better to specify instructions that are unique to a 
> specific CPU.
> But I can remove it.

Yes please.

Jan

  parent reply	other threads:[~2015-07-13  7:13 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10  0:52 [PATCH v4 00/15] Alternate p2m: support multiple copies of host p2m Ed White
2015-07-10  0:52 ` [PATCH v4 01/15] common/domain: Helpers to pause a domain while in context Ed White
2015-07-10  0:52 ` [PATCH v4 02/15] VMX: VMFUNC and #VE definitions and detection Ed White
2015-07-10  0:52 ` [PATCH v4 03/15] VMX: implement suppress #VE Ed White
2015-07-10  9:09   ` Jan Beulich
2015-07-10 19:22     ` Sahita, Ravi
2015-07-10  0:52 ` [PATCH v4 04/15] x86/HVM: Hardware alternate p2m support detection Ed White
2015-07-10  0:52 ` [PATCH v4 05/15] x86/altp2m: basic data structures and support routines Ed White
2015-07-10  9:13   ` Jan Beulich
2015-07-10  0:52 ` [PATCH v4 06/15] VMX/altp2m: add code to support EPTP switching and #VE Ed White
2015-07-10 16:48   ` George Dunlap
2015-07-10  0:52 ` [PATCH v4 07/15] VMX: add VMFUNC leaf 0 (EPTP switching) to emulator Ed White
2015-07-10  9:30   ` Jan Beulich
2015-07-11 20:01     ` Sahita, Ravi
2015-07-11 21:25       ` Sahita, Ravi
2015-07-13  7:18         ` Jan Beulich
2015-07-13  7:13       ` Jan Beulich [this message]
2015-07-10  0:52 ` [PATCH v4 08/15] x86/altp2m: add control of suppress_ve Ed White
2015-07-10  9:39   ` Jan Beulich
2015-07-10 11:11     ` George Dunlap
2015-07-10 11:49       ` Jan Beulich
2015-07-10 11:56         ` George Dunlap
2015-07-10 17:02   ` George Dunlap
2015-07-11 21:29     ` Sahita, Ravi
2015-07-10  0:52 ` [PATCH v4 09/15] x86/altp2m: alternate p2m memory events Ed White
2015-07-10  1:01   ` Lengyel, Tamas
2015-07-10  0:52 ` [PATCH v4 10/15] x86/altp2m: add remaining support routines Ed White
2015-07-10  9:41   ` Jan Beulich
2015-07-10 17:15     ` George Dunlap
2015-07-11 20:20       ` Sahita, Ravi
2015-07-10  0:52 ` [PATCH v4 11/15] x86/altp2m: define and implement alternate p2m HVMOP types Ed White
2015-07-10 10:01   ` Jan Beulich
2015-07-10 22:03     ` Sahita, Ravi
2015-07-13  7:25       ` Jan Beulich
2015-07-13 23:39         ` Sahita, Ravi
2015-07-14  8:58           ` Jan Beulich
2015-07-10  0:52 ` [PATCH v4 12/15] x86/altp2m: Add altp2mhvm HVM domain parameter Ed White
2015-07-10  8:53   ` Wei Liu
2015-07-10 17:32   ` George Dunlap
2015-07-10 22:12     ` Sahita, Ravi
2015-07-14 11:50       ` George Dunlap
2015-07-10  0:52 ` [PATCH v4 13/15] x86/altp2m: XSM hooks for altp2m HVM ops Ed White
2015-07-10  0:52 ` [PATCH v4 14/15] tools/libxc: add support to altp2m hvmops Ed White
2015-07-10  8:46   ` Ian Campbell
2015-07-10  0:52 ` [PATCH v4 15/15] tools/xen-access: altp2m testcases Ed White
2015-07-10  1:35   ` Lengyel, Tamas
2015-07-11  6:06     ` Razvan Cojocaru
2015-07-10  8:50   ` Ian Campbell
2015-07-10  8:55     ` Wei Liu
2015-07-10  9:12       ` Wei Liu
2015-07-10  9:20       ` Ian Campbell

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=55A3813E020000780008FF02@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=edmund.h.white@intel.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=ravi.sahita@intel.com \
    --cc=tim@xen.org \
    --cc=tlengyel@novetta.com \
    --cc=wei.liu2@citrix.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).