All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Bharat Bhushan <r65777@freescale.com>
Cc: <kvm-ppc@vger.kernel.org>, <kvm@vger.kernel.org>,
	<scottwood@freescale.com>, <tiejun.chen@windriver.com>,
	Bharat Bhushan <Bharat.Bhushan@freescale.com>
Subject: Re: [PATCH] powerpc: export debug register save function for KVM
Date: Fri, 10 May 2013 11:15:29 +0200	[thread overview]
Message-ID: <31B4CDB8-CD6D-4F02-8CE7-770D301DE8A3@suse.de> (raw)
In-Reply-To: <1367919653-30414-4-git-send-email-Bharat.Bhushan@freescale.com>


On 07.05.2013, at 11:40, Bharat Bhushan wrote:

> KVM need this function when switching from vcpu to user-space
> thread. My subsequent patch will use this function.
> 
> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> ---
> arch/powerpc/include/asm/switch_to.h |    4 ++++
> arch/powerpc/kernel/process.c        |    3 ++-
> 2 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/switch_to.h b/arch/powerpc/include/asm/switch_to.h
> index 200d763..50b357f 100644
> --- a/arch/powerpc/include/asm/switch_to.h
> +++ b/arch/powerpc/include/asm/switch_to.h
> @@ -30,6 +30,10 @@ extern void enable_kernel_spe(void);
> extern void giveup_spe(struct task_struct *);
> extern void load_up_spe(struct task_struct *);
> 
> +#ifdef CONFIG_PPC_ADV_DEBUG_REGS
> +extern void switch_booke_debug_regs(struct thread_struct *new_thread);
> +#endif
> +
> #ifndef CONFIG_SMP
> extern void discard_lazy_cpu_state(void);
> #else
> diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> index ca89375..a938138 100644
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -362,12 +362,13 @@ static void prime_debug_regs(struct thread_struct *thread)
>  * debug registers, set the debug registers from the values
>  * stored in the new thread.
>  */
> -static void switch_booke_debug_regs(struct thread_struct *new_thread)
> +void switch_booke_debug_regs(struct thread_struct *new_thread)
> {
> 	if ((current->thread.debug.dbcr0 & DBCR0_IDM)
> 		|| (new_thread->debug.dbcr0 & DBCR0_IDM))
> 			prime_debug_regs(new_thread);
> }
> +EXPORT_SYMBOL(switch_booke_debug_regs);

EXPORT_SYMBOL_GPL


Alex

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Bharat Bhushan <r65777@freescale.com>
Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org,
	scottwood@freescale.com, tiejun.chen@windriver.com,
	Bharat Bhushan <Bharat.Bhushan@freescale.com>
Subject: Re: [PATCH] powerpc: export debug register save function for KVM
Date: Fri, 10 May 2013 09:15:29 +0000	[thread overview]
Message-ID: <31B4CDB8-CD6D-4F02-8CE7-770D301DE8A3@suse.de> (raw)
In-Reply-To: <1367919653-30414-4-git-send-email-Bharat.Bhushan@freescale.com>


On 07.05.2013, at 11:40, Bharat Bhushan wrote:

> KVM need this function when switching from vcpu to user-space
> thread. My subsequent patch will use this function.
> 
> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> ---
> arch/powerpc/include/asm/switch_to.h |    4 ++++
> arch/powerpc/kernel/process.c        |    3 ++-
> 2 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/switch_to.h b/arch/powerpc/include/asm/switch_to.h
> index 200d763..50b357f 100644
> --- a/arch/powerpc/include/asm/switch_to.h
> +++ b/arch/powerpc/include/asm/switch_to.h
> @@ -30,6 +30,10 @@ extern void enable_kernel_spe(void);
> extern void giveup_spe(struct task_struct *);
> extern void load_up_spe(struct task_struct *);
> 
> +#ifdef CONFIG_PPC_ADV_DEBUG_REGS
> +extern void switch_booke_debug_regs(struct thread_struct *new_thread);
> +#endif
> +
> #ifndef CONFIG_SMP
> extern void discard_lazy_cpu_state(void);
> #else
> diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> index ca89375..a938138 100644
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -362,12 +362,13 @@ static void prime_debug_regs(struct thread_struct *thread)
>  * debug registers, set the debug registers from the values
>  * stored in the new thread.
>  */
> -static void switch_booke_debug_regs(struct thread_struct *new_thread)
> +void switch_booke_debug_regs(struct thread_struct *new_thread)
> {
> 	if ((current->thread.debug.dbcr0 & DBCR0_IDM)
> 		|| (new_thread->debug.dbcr0 & DBCR0_IDM))
> 			prime_debug_regs(new_thread);
> }
> +EXPORT_SYMBOL(switch_booke_debug_regs);

EXPORT_SYMBOL_GPL


Alex


  reply	other threads:[~2013-05-10  9:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07  9:40 [PATCH v4] KVM :PPC: Userspace Debug support Bharat Bhushan
2013-05-07  9:52 ` Bharat Bhushan
2013-05-07  9:40 ` [PATCH] powerpc: remove unnecessary line continuations Bharat Bhushan
2013-05-07  9:52   ` Bharat Bhushan
2013-05-07  9:40 ` [PATCH] powerpc: move debug registers in a structure Bharat Bhushan
2013-05-07  9:52   ` Bharat Bhushan
2013-05-07  9:40 ` [PATCH] powerpc: export debug register save function for KVM Bharat Bhushan
2013-05-07  9:52   ` Bharat Bhushan
2013-05-10  9:15   ` Alexander Graf [this message]
2013-05-10  9:15     ` Alexander Graf
2013-05-07  9:40 ` [PATCH] KVM: PPC: exit to user space on "ehpriv" instruction Bharat Bhushan
2013-05-07  9:52   ` Bharat Bhushan
2013-05-07  9:40 ` [PATCH] KVM: PPC: Using "struct debug_reg" Bharat Bhushan
2013-05-07  9:52   ` Bharat Bhushan
2013-05-07  9:40 ` [PATCH] KVM: PPC: Add userspace debug stub support Bharat Bhushan
2013-05-07  9:52   ` Bharat Bhushan
2013-05-10 10:18   ` Alexander Graf
2013-05-10 10:18     ` Alexander Graf
2013-05-10 17:31     ` Bhushan Bharat-R65777
2013-05-10 17:31       ` Bhushan Bharat-R65777
2013-05-10 17:44       ` Alexander Graf
2013-05-10 17:44         ` Alexander Graf
2013-05-11 10:24         ` Bhushan Bharat-R65777
2013-05-11 10:24           ` Bhushan Bharat-R65777
2013-05-11 13:18           ` Alexander Graf
2013-05-11 13:18             ` Alexander Graf
2013-05-13 14:33             ` Scott Wood
2013-05-13 14:33               ` Scott Wood

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=31B4CDB8-CD6D-4F02-8CE7-770D301DE8A3@suse.de \
    --to=agraf@suse.de \
    --cc=Bharat.Bhushan@freescale.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=r65777@freescale.com \
    --cc=scottwood@freescale.com \
    --cc=tiejun.chen@windriver.com \
    /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.