All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>
Subject: Re: [Xen-devel] [PATCH v3 7/7] x86/tlb: use Xen L0 assisted TLB flush when available
Date: Tue, 28 Jan 2020 18:38:21 +0100	[thread overview]
Message-ID: <20200128173821.GT57924@desktop-tdan49n.eng.citrite.net> (raw)
In-Reply-To: <65953c34-b65e-44c9-5013-fe7172412e39@citrix.com>

On Tue, Jan 28, 2020 at 05:20:25PM +0000, Andrew Cooper wrote:
> On 28/01/2020 17:16, Roger Pau Monné wrote:
> >>>> OOI why isn't tlb_clk_enabled set to false when Xen determines to use L0
> >>>> assisted flush?
> >>> L0 assisted flush can fail (ie: return an error), and in that case Xen
> >>> would be better to continue using the timestamped tlb, as it could
> >>> avoid some flushes.
> >> Do you need to set tlb_clk_enabled in that case?
> > AFAICT it's safe to enable the TLB timestamps after being disabled,
> > but hypervisor_flush_tlb could fail intermittently with EBUSY in the
> > Xen implementation, and I don't really want that to cause spurious
> > enabling of the timestamps periodically.
> 
> What causes -EBUSY?

My bad, it's not EBUSY, it's ERESTART but that won't be returned to
the caller.

> I don't think it is reasonable for the hypercall to fail like that. 
> There is no circumstance ever where a TLB flush is wanted, and it is
> able to be deferred.

After this series ERESTART is only used by the shadow flush
implementation, and I'm not sure I'm confident enough to try to change
the shadow code in order to not do that, also because I think the
interest is likely much lower than for the HAP case.

> Forcing all callers to loop while busy is a terrible interface.

Well, the whole implementation of hvm_flush_vcpu_tlb is quite clumsy
because it attempts to pause each vCPU to be flushed, which for guests
with a high number of vCPUs makes it likely slower than just using a
shorthand IPI inside the guest.

Thanks, Roger.

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

  reply	other threads:[~2020-01-28 17:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 18:11 [Xen-devel] [PATCH v3 0/7] x86: improve assisted tlb flush and use it in guest mode Roger Pau Monne
2020-01-27 18:11 ` [Xen-devel] [PATCH v3 1/7] x86/tlb: fix NEED_FLUSH return type Roger Pau Monne
2020-01-28 14:17   ` Wei Liu
2020-02-03 11:48     ` Jan Beulich
2020-01-27 18:11 ` [Xen-devel] [PATCH v3 2/7] x86/hvm: allow ASID flush when v != current Roger Pau Monne
2020-02-06 11:15   ` Wei Liu
2020-01-27 18:11 ` [Xen-devel] [PATCH v3 3/7] x86/paging: add TLB flush hooks Roger Pau Monne
2020-02-05 20:52   ` Wei Liu
2020-01-27 18:11 ` [Xen-devel] [PATCH v3 4/7] x86/hap: improve hypervisor assisted guest TLB flush Roger Pau Monne
2020-02-06 11:23   ` Wei Liu
2020-01-27 18:11 ` [Xen-devel] [PATCH v3 5/7] x86/tlb: introduce a flush guests TLB flag Roger Pau Monne
2020-02-06 12:59   ` Wei Liu
2020-01-27 18:11 ` [Xen-devel] [PATCH v3 6/7] x86/tlb: allow disabling the TLB clock Roger Pau Monne
2020-02-06 13:31   ` Wei Liu
2020-02-06 13:46     ` Roger Pau Monné
2020-01-27 18:11 ` [Xen-devel] [PATCH v3 7/7] x86/tlb: use Xen L0 assisted TLB flush when available Roger Pau Monne
2020-01-28 14:17   ` Wei Liu
2020-01-28 14:57     ` Roger Pau Monné
2020-01-28 16:24       ` Wei Liu
2020-01-28 17:16         ` Roger Pau Monné
2020-01-28 17:20           ` Andrew Cooper
2020-01-28 17:38             ` Roger Pau Monné [this message]
2020-02-06 13:49   ` Wei Liu
2020-02-06 14:09     ` Roger Pau Monné
2020-02-06 14:46       ` Jan Beulich
2020-02-06 15:37         ` Roger Pau Monné
2020-02-05 16:14 ` [Xen-devel] [PATCH v3 0/7] x86: improve assisted tlb flush and use it in guest mode Roger Pau Monné
2020-02-05 16:44   ` Jan Beulich

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=20200128173821.GT57924@desktop-tdan49n.eng.citrite.net \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=wl@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 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.