From patchwork Fri May 19 05:40:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharata B Rao X-Patchwork-Id: 9735873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EDFD9601C2 for ; Fri, 19 May 2017 05:45:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFA35288B6 for ; Fri, 19 May 2017 05:45:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFCD0288BE; Fri, 19 May 2017 05:45:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3A697288B6 for ; Fri, 19 May 2017 05:45:32 +0000 (UTC) Received: from localhost ([::1]:56652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBajD-0001fW-M9 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 May 2017 01:45:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBafi-0007iz-Vc for qemu-devel@nongnu.org; Fri, 19 May 2017 01:41:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBaff-0005Zp-To for qemu-devel@nongnu.org; Fri, 19 May 2017 01:41:55 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59370) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dBaff-0005ZO-Jj for qemu-devel@nongnu.org; Fri, 19 May 2017 01:41:51 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4J5ehFC117131 for ; Fri, 19 May 2017 01:41:50 -0400 Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ahrwmm22f-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 19 May 2017 01:41:50 -0400 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 May 2017 15:41:47 +1000 Received: from d23relay06.au.ibm.com (202.81.31.225) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 19 May 2017 15:41:44 +1000 Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4J5faOt52232220; Fri, 19 May 2017 15:41:44 +1000 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v4J5fB0k011329; Fri, 19 May 2017 15:41:12 +1000 Received: from bharata.in.ibm.com ([9.77.210.112]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v4J5f49p010863; Fri, 19 May 2017 15:41:10 +1000 From: Bharata B Rao To: qemu-devel@nongnu.org Date: Fri, 19 May 2017 11:10:39 +0530 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495172439-1504-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1495172439-1504-1-git-send-email-bharata@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17051905-0016-0000-0000-0000023DA735 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17051905-0017-0000-0000-000006BAF95F Message-Id: <1495172439-1504-5-git-send-email-bharata@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-19_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705190039 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [RFC PATCH v2 4/4] spapr: Fix migration of Radix guests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rnsastry@linux.vnet.ibm.com, qemu-ppc@nongnu.org, Bharata B Rao , sam.bobroff@au1.ibm.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fix migration of radix guests by ensuring that we issue KVM_PPC_CONFIGURE_V3_MMU for radix case post migration. Reported-by: Nageswara R Sastry Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index daf335c..8f20f14 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1400,6 +1400,18 @@ static int spapr_post_load(void *opaque, int version_id) err = spapr_rtc_import_offset(&spapr->rtc, spapr->rtc_offset); } + if (spapr->patb_entry) { + PowerPCCPU *cpu = POWERPC_CPU(first_cpu); + if (kvmppc_has_cap_mmu_radix() && kvm_enabled()) { + err = kvmppc_configure_v3_mmu(cpu, SPAPR_PROC_TABLE_RADIX, + ((cpu->env.spr[SPR_LPCR] & LPCR_GTSE) ? SPAPR_PROC_TABLE_GTSE : + 0), spapr->patb_entry); + } else { + error_report("Radix guest is unsupported by the host"); + return -EINVAL; + } + } + return err; }