All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Alex Nixon <alex.nixon@citrix.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 2/7] x86/paravirt:  Add paravirt hook for wbinvd_halt
Date: Thu, 21 Aug 2008 11:16:52 -0700	[thread overview]
Message-ID: <48ADB114.2000304@goop.org> (raw)
In-Reply-To: <1219341888-23191-2-git-send-email-alex.nixon@citrix.com>

Alex Nixon wrote:
> The native case of wb_invd_halt uses inline asm to ensure the compiler doesn't reorder the sequence of instructions, which has the side-effect of skirting around the paravirt hooks for those instructions.  Thus, create a new hook for this case.
>   

Not necessary.  Halting in Xen doesn't require the caches to be flushed
in this way, and I think that would be true for any virtual environment
(and if it were, the invalidate/halt instruction sequence would work
anyway).

The correct fix is to make sure that the native_play_dead calls this,
but the xen_play_dead doesn't (ie, make sure it's not in the common code
path).

    J

> Signed-off-by: Alex Nixon <alex.nixon@citrix.com>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> ---
>  arch/x86/kernel/paravirt.c  |    1 +
>  include/asm-x86/paravirt.h  |    6 ++++++
>  include/asm-x86/processor.h |    3 ++-
>  3 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
> index 8ffe4d1..66d6d0d 100644
> --- a/arch/x86/kernel/paravirt.c
> +++ b/arch/x86/kernel/paravirt.c
> @@ -299,6 +299,7 @@ struct pv_irq_ops pv_irq_ops = {
>  	.restore_fl = native_restore_fl,
>  	.irq_disable = native_irq_disable,
>  	.irq_enable = native_irq_enable,
> +	.wbinvd_halt = native_wbinvd_halt,
>  	.safe_halt = native_safe_halt,
>  	.halt = native_halt,
>  #ifdef CONFIG_X86_64
> diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
> index fd922c3..5360f3f 100644
> --- a/include/asm-x86/paravirt.h
> +++ b/include/asm-x86/paravirt.h
> @@ -194,6 +194,7 @@ struct pv_irq_ops {
>  	void (*restore_fl)(unsigned long);
>  	void (*irq_disable)(void);
>  	void (*irq_enable)(void);
> +	void (*wbinvd_halt)(void);
>  	void (*safe_halt)(void);
>  	void (*halt)(void);
>  
> @@ -716,6 +717,11 @@ static inline void raw_safe_halt(void)
>  	PVOP_VCALL0(pv_irq_ops.safe_halt);
>  }
>  
> +static inline void wbinvd_halt(void)
> +{
> +	PVOP_VCALL0(pv_irq_ops.wbinvd_halt);
> +}
> +
>  static inline void halt(void)
>  {
>  	PVOP_VCALL0(pv_irq_ops.safe_halt);
> diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
> index bcfc727..75db315 100644
> --- a/include/asm-x86/processor.h
> +++ b/include/asm-x86/processor.h
> @@ -558,6 +558,7 @@ static inline void load_sp0(struct tss_struct *tss,
>  	native_load_sp0(tss, thread);
>  }
>  
> +#define wbinvd_halt native_wbinvd_halt
>  #define set_iopl_mask native_set_iopl_mask
>  #endif /* CONFIG_PARAVIRT */
>  
> @@ -733,7 +734,7 @@ extern unsigned long		idle_nomwait;
>   *
>   * Systems without cache can just go into halt.
>   */
> -static inline void wbinvd_halt(void)
> +static inline void native_wbinvd_halt(void)
>  {
>  	mb();
>  	/* check for clflush to determine if wbinvd is legal */
>   


  parent reply	other threads:[~2008-08-21 18:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-21 18:04 [PATCH 1/7] x86/paravirt: Add hooks for CPU hotplugging Alex Nixon
2008-08-21 18:04 ` [PATCH 2/7] x86/paravirt: Add paravirt hook for wbinvd_halt Alex Nixon
2008-08-21 18:04   ` [PATCH 3/7] Xen: Add Xen implementation of wbinvd_halt Alex Nixon
2008-08-21 18:04     ` [PATCH 4/7] x86_32: Clean up play_dead Alex Nixon
2008-08-21 18:04       ` [PATCH 5/7] x86: Unify x86_32 and x86_64 play_dead into one function Alex Nixon
2008-08-21 18:04         ` [PATCH 6/7] x86: Separate generic cpu disabling code from APIC writes in cpu_disable Alex Nixon
2008-08-21 18:04           ` [PATCH 7/7] Xen: Implement CPU hotplugging Alex Nixon
2008-08-21 18:37             ` Jeremy Fitzhardinge
2008-08-21 18:16   ` Jeremy Fitzhardinge [this message]
2008-08-21 18:19 ` [PATCH 1/7] x86/paravirt: Add hooks for " Jeremy Fitzhardinge

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=48ADB114.2000304@goop.org \
    --to=jeremy@goop.org \
    --cc=alex.nixon@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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.