All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <dunlapg@umich.edu>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Adrian Pop <apop@bitdefender.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Jan Beulich <jbeulich@suse.com>,
	Sergej Proskurin <proskurin@sec.in.tum.de>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 2/3] x86/altp2m: Add a hvmop for setting the suppress #VE bit
Date: Sun, 23 Sep 2018 17:33:36 +0100	[thread overview]
Message-ID: <CAFLBxZaR3Ugx=OJny=qgvb_AxWkUa3KgsA200mskOCW9Pxv3NQ@mail.gmail.com> (raw)
In-Reply-To: <CAFLBxZY0am2E01iLpZDcboFG7a1-S47Dwnd-qjp5YqQxGAdejQ@mail.gmail.com>

Sorry, looks like this may not have gone through.
 -G
On Thu, Sep 20, 2018 at 5:08 PM George Dunlap <george.dunlap@citrix.com> wrote:
>
> On Thu, Sep 20, 2018 at 4:53 PM Razvan Cojocaru
> <rcojocaru@bitdefender.com> wrote:
> >
> > On 9/20/18 2:34 PM, George Dunlap wrote:
> > >> +int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
> > >> +                        unsigned int altp2m_idx)
> > > This should clearly be in p2m.c, and...
> > >
> > >> +{
> > >> +    struct p2m_domain *host_p2m = p2m_get_hostp2m(d);
> > >> +    struct p2m_domain *ap2m = NULL;
> > >> +    struct p2m_domain *p2m;
> > >> +    mfn_t mfn;
> > >> +    p2m_access_t a;
> > >> +    p2m_type_t t;
> > >> +    int rc;
> > >> +
> > >> +    if ( !cpu_has_vmx_virt_exceptions )
> > >> +        return -EOPNOTSUPP;
> > > We should avoid Intel-specific checks in common code.
> > >
> > > In fact, this is wrong, because you can choose to run a guest in shadow
> > > mode even on a system with virt exceptions -- in which case you'd
> > > trigger the ASSERT() in p2m-pt.c:p2m_pt_set_entry().
> > >
> > > Probably what should happen is that we should move the vmx check into
> > > p2m-ept.c:p2m_ept_set_entry(), and replace the ASSERT(sve = 0) in
> > > p2m-pt.c:p2m_pt_set_entry() with "if ( sve != 0 ) return -ENOTSUPP;".
> > >
> > > Although what should probably *really* happen is that
> > > `HVMOP_altp2m_vcpu_enable_notify` should fail with -EOPNOTSUPP instead
> > > of silently succeeding.
> >
> > Do you mean HVMOP_altp2m_set_suppress_ve here, or am I misunderstanding
> > your comment? I'm happy to do the exact modifications you've requested
> > above but I'm afraid I don't follow the HVMOP_altp2m_vcpu_enable_notify
> > comment.
>
> At the moment, it appears that you can call
> HVMOP_altp2m_vcpu_enable_notify to set a vcpu's veinfo_gfn even if the
> hardware or the p2m mode doesn't support #VE.  It would be better if
> callers got the -EOPNOTSUPP error at that point, rather than having
> vcpu_enable_notify succeed and then having set_suppress_ve fail.
>
> To be clear, I'm not requiring that as a clean-up, I'm just saying
> that such a change would be an improvement (which you may consider
> doing if you wish).
>
>  -George

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

  parent reply	other threads:[~2018-09-23 16:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03 15:48 [PATCH v5 0/3] Add hvmops for setting and getting the suppress #VE bit Adrian Pop
2018-09-03 15:48 ` [PATCH v5 1/3] x86/mm: Change default value for suppress #VE in set_mem_access() Adrian Pop
2018-09-11 18:08   ` Tamas K Lengyel
2018-09-12  4:02     ` Adrian Pop
2018-09-03 15:48 ` [PATCH v5 2/3] x86/altp2m: Add a hvmop for setting the suppress #VE bit Adrian Pop
2018-09-20 11:34   ` George Dunlap
2018-09-20 11:38     ` Razvan Cojocaru
2018-09-20 15:52     ` Razvan Cojocaru
     [not found]       ` <CAFLBxZY0am2E01iLpZDcboFG7a1-S47Dwnd-qjp5YqQxGAdejQ@mail.gmail.com>
2018-09-23 16:33         ` George Dunlap [this message]
2018-09-23 17:09           ` Razvan Cojocaru
2018-09-03 15:48 ` [PATCH v5 3/3] x86/altp2m: Add a hvmop for querying " Adrian Pop
2018-09-11 18:02   ` Tamas K Lengyel
2018-09-12  4:01     ` Adrian Pop
2018-09-19 14:48   ` Wei Liu
2018-09-20  7:46     ` Razvan Cojocaru
2018-09-20  7:53       ` Wei Liu
2018-09-20  8:38         ` Wei Liu
2018-09-20 12:50   ` George Dunlap
2018-09-21 13:16     ` Razvan Cojocaru
2018-09-21 13:17       ` Razvan Cojocaru

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='CAFLBxZaR3Ugx=OJny=qgvb_AxWkUa3KgsA200mskOCW9Pxv3NQ@mail.gmail.com' \
    --to=dunlapg@umich.edu \
    --cc=andrew.cooper3@citrix.com \
    --cc=apop@bitdefender.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=proskurin@sec.in.tum.de \
    --cc=rcojocaru@bitdefender.com \
    --cc=sstabellini@kernel.org \
    --cc=tamas@tklengyel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.