From: Wei Liu <wei.liu2@citrix.com>
To: Paul Durrant <paul.durrant@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>, Keir Fraser <keir@xen.org>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Jan Beulich <jbeulich@suse.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 2/2] x86/hvm/viridian: Enable APIC assist enlightenment
Date: Wed, 16 Mar 2016 18:30:53 +0000 [thread overview]
Message-ID: <20160316183053.GI22103@citrix.com> (raw)
In-Reply-To: <1458150252-25683-3-git-send-email-paul.durrant@citrix.com>
On Wed, Mar 16, 2016 at 05:44:12PM +0000, Paul Durrant wrote:
> This patch adds code to enable the APIC assist enlightenment which,
> under certain conditions, means that the guest can avoid an EOI of
> the local APIC and thereby avoid a VMEXIT.
>
> Use of the enlightenment by the hypervisor is under control of the
> toolstack, and is added to the default set.
>
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Keir Fraser <keir@xen.org>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
>
> v3:
> - Re-instated read-modify-write for forwards compatibility
> - Fix a coding style issue
>
> v2:
> - Removed some code duplication and unnecessary read-modify-write
> operations on the APIC assist word.
> - Stated in the xl.cfg text that the enlightenment has no effect if
> posted interrupts are in use.
> - Added the enlightenment to the default set.
> ---
> docs/man/xl.cfg.pod.5 | 13 ++++++++-
> tools/libxl/libxl_dom.c | 4 +++
> tools/libxl/libxl_types.idl | 1 +
> xen/arch/x86/hvm/viridian.c | 59 ++++++++++++++++++++++++++++++++++----
> xen/arch/x86/hvm/vlapic.c | 58 +++++++++++++++++++++++++++++++++----
> xen/include/asm-x86/hvm/viridian.h | 5 ++++
> xen/include/public/hvm/params.h | 7 ++++-
> 7 files changed, 134 insertions(+), 13 deletions(-)
>
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 56b1117..1ba026b 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -1484,10 +1484,21 @@ This set incorporates use of hypercalls for remote TLB flushing.
> This enlightenment may improve performance of Windows guests running
> on hosts with higher levels of (physical) CPU contention.
>
> +=item B<apic_assist>
> +
> +This set incorporates use of the APIC assist page to avoid EOI of
> +the local APIC.
> +This enlightenment may improve performance of Windows guests,
> +particularly those running PV drivers that make use of per-vcpu
> +event channel upcall vectors.
I think this can be changed to
This enlightenment may improve performance of guests that make use of
per-vcpu event channel upcall vectors.
Surely Linux can benefit from this too, right?
> +Note that this enlightenment will have no effect if the guest is
> +using APICv posted interrupts.
> +
> =item B<defaults>
>
> This is a special value that enables the default set of groups, which
> -is currently the B<base>, B<freq> and B<time_ref_count> groups.
> +is currently the B<base>, B<freq>, B<time_ref_count> and B<apic_assist>
> +groups.
>
> =item B<all>
>
> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> index b825b98..09d3bca 100644
> --- a/tools/libxl/libxl_dom.c
> +++ b/tools/libxl/libxl_dom.c
> @@ -211,6 +211,7 @@ static int hvm_set_viridian_features(libxl__gc *gc, uint32_t domid,
> libxl_bitmap_set(&enlightenments, LIBXL_VIRIDIAN_ENLIGHTENMENT_BASE);
> libxl_bitmap_set(&enlightenments, LIBXL_VIRIDIAN_ENLIGHTENMENT_FREQ);
> libxl_bitmap_set(&enlightenments, LIBXL_VIRIDIAN_ENLIGHTENMENT_TIME_REF_COUNT);
> + libxl_bitmap_set(&enlightenments, LIBXL_VIRIDIAN_ENLIGHTENMENT_APIC_ASSIST);
> }
>
> libxl_for_each_set_bit(v, info->u.hvm.viridian_enable) {
> @@ -253,6 +254,9 @@ static int hvm_set_viridian_features(libxl__gc *gc, uint32_t domid,
> if (libxl_bitmap_test(&enlightenments, LIBXL_VIRIDIAN_ENLIGHTENMENT_HCALL_REMOTE_TLB_FLUSH))
> mask |= HVMPV_hcall_remote_tlb_flush;
>
> + if (libxl_bitmap_test(&enlightenments, LIBXL_VIRIDIAN_ENLIGHTENMENT_APIC_ASSIST))
> + mask |= HVMPV_apic_assist;
> +
> if (mask != 0 &&
> xc_hvm_param_set(CTX->xch,
> domid,
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 632c009..e3be957 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -221,6 +221,7 @@ libxl_viridian_enlightenment = Enumeration("viridian_enlightenment", [
> (2, "time_ref_count"),
> (3, "reference_tsc"),
> (4, "hcall_remote_tlb_flush"),
> + (5, "apic_assist"),
> ])
>
Missing a LIBXL_HAVE macro in libxl.h for this new field.
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-03-16 18:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 17:44 [PATCH v3 0/2] x86/hvm/viridian: APIC assist Paul Durrant
2016-03-16 17:44 ` [PATCH v3 1/2] x86/hvm/viridian: keep APIC assist page mapped Paul Durrant
2016-03-17 8:09 ` Paul Durrant
2016-03-16 17:44 ` [PATCH v3 2/2] x86/hvm/viridian: Enable APIC assist enlightenment Paul Durrant
2016-03-16 18:30 ` Wei Liu [this message]
2016-03-17 8:11 ` Paul Durrant
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=20160316183053.GI22103@citrix.com \
--to=wei.liu2@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=paul.durrant@citrix.com \
--cc=stefano.stabellini@eu.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.