xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
	konrad.wilk@oracle.com, George.Dunlap@eu.citrix.com,
	andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com,
	tim@xen.org, julien.grall@arm.com, jbeulich@suse.com,
	xen-devel@lists.xenproject.org, roger.pau@citrix.com
Subject: Re: [PATCH V3] x86/altp2m: add altp2m_vcpu_disable_notify
Date: Wed, 2 Jan 2019 11:50:50 +0000	[thread overview]
Message-ID: <20190102115050.pq45kj2ltibvaw5k@zion.uk.xensource.com> (raw)
In-Reply-To: <1545145904-6066-1-git-send-email-rcojocaru@bitdefender.com>

On Tue, Dec 18, 2018 at 05:11:44PM +0200, Razvan Cojocaru wrote:
> Allow altp2m users to disable #VE/VMFUNC alone. Currently it is
> only possible to disable this functionality when we disable altp2m
> completely; #VE/VMFUNC can only be enabled once per altp2m session.
> 
> In addition to making things complete, disabling #VE is also a
> workaround for CFW116 ("When Virtualization Exceptions are Enabled,
> EPT Violations May Generate Erroneous Virtualization Exceptions")
> on Xeon E-2100 CPUs.
> 
> Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
> 
> ---
> Changes since V2:
>  - Fixed compilation by completing the removal of all references
>    to "pad".
> 
> Changes since V1:
>  - Updated the patch description to specify E-2100.
>  - Made trying to disable #VE when it's already disabled a no-op.
>  - Removed leftover uint32_t pad; from struct
>    xen_hvm_altp2m_vcpu_disable_notify.
> ---
>  tools/libxc/include/xenctrl.h   |  2 ++
>  tools/libxc/xc_altp2m.c         | 22 ++++++++++++++++++++++
>  xen/arch/x86/hvm/hvm.c          | 28 ++++++++++++++++++++++++++++
>  xen/include/public/hvm/hvm_op.h | 11 ++++++++++-
>  4 files changed, 62 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index 97ae965..31cdda7 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -1932,6 +1932,8 @@ int xc_altp2m_get_domain_state(xc_interface *handle, uint32_t dom, bool *state);
>  int xc_altp2m_set_domain_state(xc_interface *handle, uint32_t dom, bool state);
>  int xc_altp2m_set_vcpu_enable_notify(xc_interface *handle, uint32_t domid,
>                                       uint32_t vcpuid, xen_pfn_t gfn);
> +int xc_altp2m_set_vcpu_disable_notify(xc_interface *handle, uint32_t domid,
> +                                      uint32_t vcpuid);
>  int xc_altp2m_create_view(xc_interface *handle, uint32_t domid,
>                            xenmem_access_t default_access, uint16_t *view_id);
>  int xc_altp2m_destroy_view(xc_interface *handle, uint32_t domid,
> diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c
> index 844b9f1..f8cd603 100644
> --- a/tools/libxc/xc_altp2m.c
> +++ b/tools/libxc/xc_altp2m.c
> @@ -91,6 +91,28 @@ int xc_altp2m_set_vcpu_enable_notify(xc_interface *handle, uint32_t domid,
>      return rc;
>  }
>  
> +int xc_altp2m_set_vcpu_disable_notify(xc_interface *handle, uint32_t domid,
> +                                      uint32_t vcpuid)
> +{
> +    int rc;
> +    DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
> +
> +    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
> +    if ( arg == NULL )
> +        return -1;
> +
> +    arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
> +    arg->cmd = HVMOP_altp2m_vcpu_disable_notify;
> +    arg->domain = domid;
> +    arg->u.disable_notify.vcpu_id = vcpuid;
> +
> +    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
> +		  HYPERCALL_BUFFER_AS_ARG(arg));

Tabs here.

With this fixed:

Acked-by: Wei Liu <wei.liu2@citrix.com>

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

  parent reply	other threads:[~2019-01-02 11:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 15:11 [PATCH V3] x86/altp2m: add altp2m_vcpu_disable_notify Razvan Cojocaru
2018-12-24 10:56 ` Andrew Cooper
2019-01-02 11:50 ` Wei Liu [this message]
2019-01-02 12:28   ` Razvan Cojocaru
2019-01-02 12:29   ` Andrew Cooper
2019-01-02 12:30     ` 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=20190102115050.pq45kj2ltibvaw5k@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --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).