From patchwork Thu Mar 6 04:06:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 327281 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4A1612C030D for ; Thu, 6 Mar 2014 15:07:26 +1100 (EST) Received: from localhost ([::1]:55629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLPad-0007ml-3f for incoming@patchwork.ozlabs.org; Wed, 05 Mar 2014 23:07:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLPaJ-0007mc-5l for qemu-devel@nongnu.org; Wed, 05 Mar 2014 23:07:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLPaD-0006Pa-72 for qemu-devel@nongnu.org; Wed, 05 Mar 2014 23:07:03 -0500 Received: from ozlabs.org ([203.10.76.45]:35262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLPaC-0006PH-Sb; Wed, 05 Mar 2014 23:06:57 -0500 Received: from kryten (ppp121-44-245-131.lns20.syd7.internode.on.net [121.44.245.131]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 2192D2C0314; Thu, 6 Mar 2014 15:06:53 +1100 (EST) Date: Thu, 6 Mar 2014 15:06:52 +1100 From: Anton Blanchard To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Message-ID: <20140306150652.1fc1313b@kryten> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.20; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.10.76.45 Cc: paulus@samba.org Subject: [Qemu-devel] [PATCH] spapr: Clear LPCR_ILE during reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Since an OS can set LPCR_ILE we must clear it during reset. Otherwise if we reset into an OS with a different endian we die when we take the first exception. This fixes an issue seen on both full emulation and KVM. Signed-off-by: Anton Blanchard diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 93d02c1..4d45197 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -739,6 +739,8 @@ static void spapr_cpu_reset(void *opaque) env->spr[SPR_HIOR] = 0; + env->spr[SPR_LPCR] &= ~LPCR_ILE; + env->external_htab = (uint8_t *)spapr->htab; env->htab_base = -1; env->htab_mask = HTAB_SIZE(spapr) - 1;