From patchwork Fri May 19 06:36:14 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: 9735891 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 E6F75601A1 for ; Fri, 19 May 2017 06:38:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4D0128628 for ; Fri, 19 May 2017 06:38:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6B732883A; Fri, 19 May 2017 06:38:11 +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 6BEA128628 for ; Fri, 19 May 2017 06:38:11 +0000 (UTC) Received: from localhost ([::1]:56808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBbYA-0005uV-HY for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 May 2017 02:38:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBbXK-0005tG-MC for qemu-devel@nongnu.org; Fri, 19 May 2017 02:37:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBbXG-00027y-8i for qemu-devel@nongnu.org; Fri, 19 May 2017 02:37:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48247) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dBbXF-00027f-Vk for qemu-devel@nongnu.org; Fri, 19 May 2017 02:37:14 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4J6YQNI034119 for ; Fri, 19 May 2017 02:37:12 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ahp1bma40-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 19 May 2017 02:37:12 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 May 2017 16:37:08 +1000 Received: from d23relay06.au.ibm.com (202.81.31.225) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 19 May 2017 16:37:07 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4J6awhv2031920; Fri, 19 May 2017 16:37:06 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v4J6aRF7022397; Fri, 19 May 2017 16:36:27 +1000 Received: from in.ibm.com ([9.77.210.112]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v4J6aNOK021763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 May 2017 16:36:26 +1000 Date: Fri, 19 May 2017 12:06:14 +0530 From: Bharata B Rao To: qemu-devel@nongnu.org References: <1495172439-1504-1-git-send-email-bharata@linux.vnet.ibm.com> <1495172439-1504-5-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1495172439-1504-5-git-send-email-bharata@linux.vnet.ibm.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-TM-AS-MML: disable x-cbid: 17051906-0040-0000-0000-0000031A092C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17051906-0041-0000-0000-00000C92BA8A Message-Id: <20170519063614.GG3446@in.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-1705190044 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: Re: [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: , Reply-To: bharata@linux.vnet.ibm.com Cc: rnsastry@linux.vnet.ibm.com, qemu-ppc@nongnu.org, 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 On Fri, May 19, 2017 at 11:10:39AM +0530, Bharata B Rao wrote: > 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); Better to use explicit 'true' and 'false' in the above call. Here is the updated patch: From 937c51cac73b4211ef153c1f5940215960383494 Mon Sep 17 00:00:00 2001 From: Bharata B Rao Date: Tue, 16 May 2017 12:19:54 +0530 Subject: [RFC PATCH v2.1 4/4] spapr: Fix migration of Radix guests 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..69e184b 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, true, + ((cpu->env.spr[SPR_LPCR] & LPCR_GTSE) ? true : false), + spapr->patb_entry); + } else { + error_report("Radix guest is unsupported by the host"); + return -EINVAL; + } + } + return err; }