All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Wei Liu <wl@xen.org>
Cc: Wei Liu <liuwe@microsoft.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Paul Durrant <pdurrant@amazon.com>,
	Michael Kelley <mikelley@microsoft.com>,
	Jan Beulich <jbeulich@suse.com>,
	Xen Development List <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCH 3/4] x86/hyperv: skeleton for L0 assisted TLB flush
Date: Wed, 12 Feb 2020 18:09:24 +0100	[thread overview]
Message-ID: <20200212170924.GT4679@Air-de-Roger> (raw)
In-Reply-To: <20200212160918.18470-4-liuwe@microsoft.com>

On Wed, Feb 12, 2020 at 04:09:17PM +0000, Wei Liu wrote:
> Implement a basic hook for L0 assisted TLB flush. The hook needs to
> check if prerequisites are met. If they are not met, it returns an error
> number to fall back to native flushes.
> 
> Introduce a new variable to indicate if hypercall page is ready.
> 
> Signed-off-by: Wei Liu <liuwe@microsoft.com>
> ---
>  xen/arch/x86/guest/hyperv/Makefile  |  1 +
>  xen/arch/x86/guest/hyperv/hyperv.c  | 17 ++++++++++++
>  xen/arch/x86/guest/hyperv/private.h |  4 +++
>  xen/arch/x86/guest/hyperv/tlb.c     | 41 +++++++++++++++++++++++++++++
>  4 files changed, 63 insertions(+)
>  create mode 100644 xen/arch/x86/guest/hyperv/tlb.c
> 
> diff --git a/xen/arch/x86/guest/hyperv/Makefile b/xen/arch/x86/guest/hyperv/Makefile
> index 68170109a9..18902c33e9 100644
> --- a/xen/arch/x86/guest/hyperv/Makefile
> +++ b/xen/arch/x86/guest/hyperv/Makefile
> @@ -1 +1,2 @@
>  obj-y += hyperv.o
> +obj-y += tlb.o
> diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c
> index b7044f7193..1cdc88e27c 100644
> --- a/xen/arch/x86/guest/hyperv/hyperv.c
> +++ b/xen/arch/x86/guest/hyperv/hyperv.c
> @@ -33,6 +33,8 @@ DEFINE_PER_CPU_READ_MOSTLY(void *, hv_input_page);
>  DEFINE_PER_CPU_READ_MOSTLY(void *, hv_vp_assist);
>  DEFINE_PER_CPU_READ_MOSTLY(uint32_t, hv_vp_index);
>  
> +static bool __read_mostly hv_hcall_page_ready;
> +
>  static uint64_t generate_guest_id(void)
>  {
>      union hv_guest_os_id id = {};
> @@ -119,6 +121,8 @@ static void __init setup_hypercall_page(void)
>      BUG_ON(!hypercall_msr.enable);
>  
>      set_fixmap_x(FIX_X_HYPERV_HCALL, mfn << PAGE_SHIFT);
> +
> +    hv_hcall_page_ready = true;

I guess filling the hypercall page in the probe function like it's
done for Xen is too early for HyperV, and hence you need this
safeguard?

TBH, maybe it would be best (and safer) to prevent using any hooks
until setup has been called, and hence this check could be pulled into
the generic hook?

Thanks, Roger.

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

  reply	other threads:[~2020-02-12 17:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 16:09 [Xen-devel] [PATCH 0/4] Xen on Hyper-V: Implement L0 assisted TLB flush Wei Liu
2020-02-12 16:09 ` [Xen-devel] [PATCH 1/4] x86/hyperv: misc cleanup Wei Liu
2020-02-12 16:53   ` Roger Pau Monné
2020-02-13 10:30     ` Wei Liu
2020-02-13  8:43   ` Durrant, Paul
2020-02-13  9:46   ` Jan Beulich
2020-02-13 12:24     ` Wei Liu
2020-02-13 13:32       ` Jan Beulich
2020-02-12 16:09 ` [Xen-devel] [PATCH 2/4] x86/hypervisor: pass flags to hypervisor_flush_tlb Wei Liu
2020-02-12 17:00   ` Roger Pau Monné
2020-02-13  8:48     ` Durrant, Paul
2020-02-13 10:29       ` Wei Liu
2020-02-13 11:56         ` Wei Liu
2020-02-12 16:09 ` [Xen-devel] [PATCH 3/4] x86/hyperv: skeleton for L0 assisted TLB flush Wei Liu
2020-02-12 17:09   ` Roger Pau Monné [this message]
2020-02-12 23:01     ` Wei Liu
2020-02-12 16:09 ` [Xen-devel] [PATCH 4/4] x86/hyperv: " Wei Liu
2020-02-12 17:43   ` Roger Pau Monné
2020-02-13  9:49     ` Jan Beulich
2020-02-13 12:25       ` Wei Liu
2020-02-13 12:20     ` Wei Liu
2020-02-13 12:41       ` Roger Pau Monné
2020-02-14 10:47         ` Wei Liu

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=20200212170924.GT4679@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=liuwe@microsoft.com \
    --cc=mikelley@microsoft.com \
    --cc=pdurrant@amazon.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.