xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Paul Durrant <paul.durrant@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>, TimDeegan <tim@xen.org>
Subject: Re: [PATCH] x86: always supply .cpuid() handler to x86_emulate()
Date: Fri, 11 Nov 2016 15:09:26 +0000	[thread overview]
Message-ID: <045820b8-cd7b-8567-eaf1-38d5aedb34ae@citrix.com> (raw)
In-Reply-To: <5825EA90020000780011E04F@prv-mh.provo.novell.com>

On 11/11/16 14:58, Jan Beulich wrote:
>>>> On 11.11.16 at 15:16, <andrew.cooper3@citrix.com> wrote:
>> On 10/11/16 12:30, Jan Beulich wrote:
>>> --- a/xen/arch/x86/traps.c
>>> +++ b/xen/arch/x86/traps.c
>>> @@ -2755,6 +2755,24 @@ static int priv_op_write_msr(unsigned in
>>>      return X86EMUL_UNHANDLEABLE;
>>>  }
>>>  
>>> +int pv_emul_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
>>> +                  unsigned int *edx, struct x86_emulate_ctxt *ctxt)
>>> +{
>>> +    struct cpu_user_regs regs = *ctxt->regs;
>> You need a CPUID faulting check here, matching the hvm side of things,
>> or you will leave a latent bug which gets exposed when switching to
>> using full x86_emulate() for PV guests.
> That addition is part of the patch actually switching to x86_emulate().
> I don't think it belongs here, as for now we don't mean to emulate
> CPUID insns.

Fine, so long as it doesn't get forgotten.

>
>> Would it be wise to add a fail_if(!ops->cpuid) to x86_emulate() to catch
>> other misuses?
> I don't think so - there may be cases where it's indeed unneeded
> (and I foresee such arising quickly once the ->validate() hooks is
> in place, addition of which is now too part of aforementioned patch).

Ok.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

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

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10 12:30 [PATCH] x86: always supply .cpuid() handler to x86_emulate() Jan Beulich
2016-11-11 13:54 ` Wei Liu
2016-11-11 16:21   ` Jan Beulich
2016-11-12  6:42     ` Wei Liu
2016-11-11 14:05 ` Paul Durrant
2016-11-11 14:16 ` Andrew Cooper
2016-11-11 14:58   ` Jan Beulich
2016-11-11 15:09     ` Andrew Cooper [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=045820b8-cd7b-8567-eaf1-38d5aedb34ae@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=paul.durrant@citrix.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --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).