From patchwork Thu Sep 22 09:04:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nikunj A. Dadhania" X-Patchwork-Id: 9344839 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 AD879601C2 for ; Thu, 22 Sep 2016 09:22:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D2C12A905 for ; Thu, 22 Sep 2016 09:22:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 902C32A908; Thu, 22 Sep 2016 09:22:41 +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 1960A2A905 for ; Thu, 22 Sep 2016 09:22:41 +0000 (UTC) Received: from localhost ([::1]:33884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn0DI-0008CZ-3h for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Sep 2016 05:22:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmzvs-00014V-Gv for qemu-devel@nongnu.org; Thu, 22 Sep 2016 05:04:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmzvn-0005yv-DT for qemu-devel@nongnu.org; Thu, 22 Sep 2016 05:04:39 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmzvn-0005yj-5q for qemu-devel@nongnu.org; Thu, 22 Sep 2016 05:04:35 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8M93Ib0058323 for ; Thu, 22 Sep 2016 05:04:34 -0400 Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) by mx0a-001b2d01.pphosted.com with ESMTP id 25kqvqctcu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 22 Sep 2016 05:04:33 -0400 Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Sep 2016 19:04:31 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 22 Sep 2016 19:04:28 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 4ED0F2BB0045; Thu, 22 Sep 2016 19:04:28 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8M94SkZ2228556; Thu, 22 Sep 2016 19:04:28 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8M94Rim007132; Thu, 22 Sep 2016 19:04:28 +1000 Received: from abhimanyu.vnet.linux.ibm.com (abhimanyu.in.ibm.com [9.124.35.51]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u8M94JxY006926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 22 Sep 2016 19:04:26 +1000 From: Nikunj A Dadhania To: Benjamin Herrenschmidt , bharata@linux.vnet.ibm.com, aik@ozlabs.ru In-Reply-To: <1474534046.2857.166.camel@kernel.crashing.org> References: <20160922052105.GD7915@in.ibm.com> <1474524441.2857.159.camel@kernel.crashing.org> <20160922061514.GF7915@in.ibm.com> <1474534046.2857.166.camel@kernel.crashing.org> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Emacs/25.0.94.1 (x86_64-redhat-linux-gnu) Date: Thu, 22 Sep 2016 14:34:19 +0530 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16092209-0004-0000-0000-0000019DCA74 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16092209-0005-0000-0000-000008BD9561 Message-Id: <87d1jw5mr0.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-09-22_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609220165 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: Re: [Qemu-devel] pseries-2.6 migration from QEMU-2.6 to QEMU-2.7 broken 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: clg@kaod.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, 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 Benjamin Herrenschmidt writes: > On Thu, 2016-09-22 at 11:45 +0530, Bharata B Rao wrote: >> On Thu, Sep 22, 2016 at 04:07:21PM +1000, Benjamin Herrenschmidt wrote: >> > >> > On Thu, 2016-09-22 at 10:51 +0530, Bharata B Rao wrote: >> > > >> > > The flag values are expected to remain same for a machine version for >> > > the migration to succeed, but this expectation is broken now. Should >> > > we make the addition of these flags conditional on machine type >> > > version ? >> > > But these flags are part of POWER8 CPU definition which is common for >> > > both pseries and upcoming powernv. >> > >> > Does this affect KVM ? (And if yes why on earth would KVM give a flying >> > f*** about the TCG instruction flags ?) ... If not, then I think we can >> > safely not care. >> >> Yes, KVM migration is broken. > > Argh then ... stupid design in QEMU. We can't fix anything without > breaking migration, yay ! Looking back in the history of the code: commit: a90db1584a00dc1d1439dc7729d99674b666b85e (target-ppc: Convert ppc cpu savevm to VMStateDescription) added this: + /* Sanity checking */ + VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU), + VMSTATE_UINT64_EQUAL(env.insns_flags2, PowerPCCPU), These flags weren't part of vmstate, I am not sure what was the reason behind adding it though. Its a bit old, Alexey do you remember? > I don't know what to do to fix that to be honest. Do we have a way to filter > what flags actually matter and filter things out when KVM is enabled ? Something like this works for KVM: TCG migration still remains broken with this. Regards, Nikunj diff --git a/target-ppc/machine.c b/target-ppc/machine.c index 4820f22..1cf3779 100644 --- a/target-ppc/machine.c +++ b/target-ppc/machine.c @@ -563,8 +563,8 @@ const VMStateDescription vmstate_ppc_cpu = { /* Sanity checking */ VMSTATE_UINTTL_EQUAL(env.msr_mask, PowerPCCPU), - VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU), - VMSTATE_UINT64_EQUAL(env.insns_flags2, PowerPCCPU), + VMSTATE_UNUSED(sizeof(target_ulong)), /* was _EQUAL(env.insns_flags) */ + VMSTATE_UNUSED(sizeof(target_ulong)), /* was _EQUAL(env.insns_flags2) */ VMSTATE_UINT32_EQUAL(env.nb_BATs, PowerPCCPU), VMSTATE_END_OF_LIST() },