From patchwork Wed Jul 16 06:02:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 370603 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 E6A1114011B for ; Wed, 16 Jul 2014 16:04:55 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbaGPGEy (ORCPT ); Wed, 16 Jul 2014 02:04:54 -0400 Received: from mail-bl2lp0211.outbound.protection.outlook.com ([207.46.163.211]:49773 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751166AbaGPGEx (ORCPT ); Wed, 16 Jul 2014 02:04:53 -0400 Received: from BLUPR03MB568.namprd03.prod.outlook.com (10.141.78.22) by BLUPR03MB134.namprd03.prod.outlook.com (10.255.212.14) with Microsoft SMTP Server (TLS) id 15.0.985.8; Wed, 16 Jul 2014 06:04:39 +0000 Received: from BY2PR03CA033.namprd03.prod.outlook.com (10.242.234.154) by BLUPR03MB568.namprd03.prod.outlook.com (10.141.78.22) with Microsoft SMTP Server (TLS) id 15.0.985.8; Wed, 16 Jul 2014 06:04:37 +0000 Received: from BY2FFO11FD014.protection.gbl (2a01:111:f400:7c0c::144) by BY2PR03CA033.outlook.office365.com (2a01:111:e400:2c2c::26) with Microsoft SMTP Server (TLS) id 15.0.985.8 via Frontend Transport; Wed, 16 Jul 2014 06:04:37 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD014.mail.protection.outlook.com (10.1.14.76) with Microsoft SMTP Server (TLS) id 15.0.980.11 via Frontend Transport; Wed, 16 Jul 2014 06:04:36 +0000 Received: from kvm.ap.freescale.net (kvm.ap.freescale.net [10.232.14.24]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s6G64Wg1028805; Tue, 15 Jul 2014 23:04:33 -0700 From: Bharat Bhushan To: , CC: , , , Bharat Bhushan Subject: [PATCH] kvm: ppc: booke: Restore SPRG3 when entering guest Date: Wed, 16 Jul 2014 11:32:44 +0530 Message-ID: <1405490564-20119-1-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.9.3 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(83322001)(6806004)(107046002)(19580395003)(95666004)(4396001)(50226001)(85852003)(92566001)(68736004)(79102001)(81542001)(104016003)(106466001)(92726001)(47776003)(87286001)(83072002)(19580405001)(77982001)(50466002)(99396002)(77156001)(84676001)(87936001)(229853001)(44976005)(76482001)(48376002)(102836001)(85306003)(74662001)(31966008)(81342001)(89996001)(46102001)(21056001)(50986999)(86362001)(62966002)(20776003)(88136002)(105606002)(36756003)(93916002)(104166001)(26826002)(64706001)(80022001)(97736001)(74502001); DIR:OUT; SFP:; SCL:1; SRVR:BLUPR03MB568; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 0274272F87 Received-SPF: Fail (: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Bharat.Bhushan@freescale.com; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-OriginatorOrg: freescale.com Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org SPRG3 is guest accessible and SPRG3 can be clobbered by host or another guest, So this need to be restored when loading guest state. Signed-off-by: Bharat Bhushan --- arch/powerpc/kvm/booke_interrupts.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S index 2c6deb5ef..0d3403f 100644 --- a/arch/powerpc/kvm/booke_interrupts.S +++ b/arch/powerpc/kvm/booke_interrupts.S @@ -459,6 +459,8 @@ lightweight_exit: * written directly to the shared area, so we * need to reload them here with the guest's values. */ + PPC_LD(r3, VCPU_SHARED_SPRG3, r5) + mtspr SPRN_SPRG3, r3 PPC_LD(r3, VCPU_SHARED_SPRG4, r5) mtspr SPRN_SPRG4W, r3 PPC_LD(r3, VCPU_SHARED_SPRG5, r5)