From patchwork Mon Apr 8 10:32:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 234727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 905C42C00CA for ; Mon, 8 Apr 2013 20:32:23 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935138Ab3DHKcW (ORCPT ); Mon, 8 Apr 2013 06:32:22 -0400 Received: from va3ehsobe010.messaging.microsoft.com ([216.32.180.30]:12749 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934597Ab3DHKcV (ORCPT ); Mon, 8 Apr 2013 06:32:21 -0400 Received: from mail114-va3-R.bigfish.com (10.7.14.231) by VA3EHSOBE004.bigfish.com (10.7.40.24) with Microsoft SMTP Server id 14.1.225.23; Mon, 8 Apr 2013 10:32:20 +0000 Received: from mail114-va3 (localhost [127.0.0.1]) by mail114-va3-R.bigfish.com (Postfix) with ESMTP id 971EC1E039E; Mon, 8 Apr 2013 10:32:20 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VS3(zzzz1f42h1fc6h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1082kzz8275bhz2dh2a8h668h839he5bhf0ah107ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) Received: from mail114-va3 (localhost.localdomain [127.0.0.1]) by mail114-va3 (MessageSwitch) id 1365417138717350_27865; Mon, 8 Apr 2013 10:32:18 +0000 (UTC) Received: from VA3EHSMHS015.bigfish.com (unknown [10.7.14.245]) by mail114-va3.bigfish.com (Postfix) with ESMTP id 9B5B738008B; Mon, 8 Apr 2013 10:32:18 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS015.bigfish.com (10.7.99.25) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 8 Apr 2013 10:32:15 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.328.11; Mon, 8 Apr 2013 10:32:15 +0000 Received: from freescale.com ([10.232.15.72]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id r38AWAp1005993; Mon, 8 Apr 2013 03:32:11 -0700 Received: by freescale.com (sSMTP sendmail emulation); Mon, 08 Apr 2013 16:02:52 +0530 From: Bharat Bhushan To: , , , CC: Bharat Bhushan Subject: [PATCH 6/7 v3] powerpc: export debug register save function for KVM Date: Mon, 8 Apr 2013 16:02:17 +0530 Message-ID: <1365417138-8202-7-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1365417138-8202-6-git-send-email-Bharat.Bhushan@freescale.com> References: <1365417138-8202-1-git-send-email-Bharat.Bhushan@freescale.com> <1365417138-8202-2-git-send-email-Bharat.Bhushan@freescale.com> <1365417138-8202-3-git-send-email-Bharat.Bhushan@freescale.com> <1365417138-8202-4-git-send-email-Bharat.Bhushan@freescale.com> <1365417138-8202-5-git-send-email-Bharat.Bhushan@freescale.com> <1365417138-8202-6-git-send-email-Bharat.Bhushan@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org From: Bharat Bhushan KVM need this function when switching from vcpu to user-space thread. My subsequent patch will use this function. Signed-off-by: Bharat Bhushan --- 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 59dd545..7b2296b 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.dbcr0 & DBCR0_IDM) || (new_thread->dbcr0 & DBCR0_IDM)) prime_debug_regs(new_thread); } +EXPORT_SYMBOL(switch_booke_debug_regs); #else /* !CONFIG_PPC_ADV_DEBUG_REGS */ #ifndef CONFIG_HAVE_HW_BREAKPOINT static void set_debug_reg_defaults(struct thread_struct *thread)