All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: tamas@tklengyel.com, wei.liu2@citrix.com,
	ian.campbell@citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@eu.citrix.co, stefano.stabellini@citrix.com,
	keir@xen.org
Subject: Re: [PATCH V2 1/2] xen, libxc: Fine grained control of REP emulation optimizations
Date: Tue, 22 Sep 2015 09:17:07 -0600	[thread overview]
Message-ID: <56018D1302000078000A4822@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1442842294-6123-2-git-send-email-rcojocaru@bitdefender.com>

>>> On 21.09.15 at 15:31, <rcojocaru@bitdefender.com> wrote:
> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -514,7 +514,8 @@ static int hvmemul_virtual_to_linear(
>       * being triggered for repeated writes to a whole page.
>       */
>      *reps = min_t(unsigned long, *reps,
> -                  unlikely(current->domain->arch.mem_access_emulate_enabled)
> +                  unlikely(current->domain->arch.mem_access_emulate_enabled &&
> +                           current->domain->arch.mem_access_emulate_each_rep)
>                             ? 1 : 4096);

unlikely() should not wrap compound conditions, or else its effect of
eliminating mis-predicted branches from the fast path won't be
achieved. In the case here I wonder though whether you couldn't
simply test only ->arch.mem_access_emulate_each_rep.

> --- a/xen/arch/x86/monitor.c
> +++ b/xen/arch/x86/monitor.c
> @@ -79,6 +79,12 @@ int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop)
>          return 0;
>      }
>  
> +    if ( mop->op == XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP )
> +    {
> +        d->arch.mem_access_emulate_each_rep = !!mop->event;
> +        return 0;
> +    }

Considering that there's another "if(mop->op == ...)" right above
this, these two together should become another switch().

Jan

  reply	other threads:[~2015-09-22 15:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21 13:31 [PATCH V2 0/2] Introspection optimization helpers Razvan Cojocaru
2015-09-21 13:31 ` [PATCH V2 1/2] xen, libxc: Fine grained control of REP emulation optimizations Razvan Cojocaru
2015-09-22 15:17   ` Jan Beulich [this message]
2015-09-22 15:28     ` Razvan Cojocaru
2015-09-22 15:39       ` Jan Beulich
2015-09-22 15:41         ` Razvan Cojocaru
2015-09-25 15:34   ` Ian Campbell
2015-09-21 13:31 ` [PATCH V2 2/2] xen: Introduce VM_EVENT_FLAG_SET_REGISTERS Razvan Cojocaru
2015-09-22 15:19   ` Jan Beulich
2015-09-22 15:34     ` Tamas K Lengyel
2015-09-22 15:39       ` Razvan Cojocaru
2015-09-22 15:35     ` Razvan Cojocaru
2015-09-22 15:39       ` Tamas K Lengyel
2015-09-21 13:58 ` [PATCH V2 0/2] Introspection optimization helpers Razvan Cojocaru
2015-09-21 14:52   ` Julien Grall

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=56018D1302000078000A4822@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=rcojocaru@bitdefender.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.co \
    --cc=tamas@tklengyel.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 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.