From nobody Tue Feb 10 01:35:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552382049951115.21275950796746; Tue, 12 Mar 2019 02:14:09 -0700 (PDT) Received: from localhost ([127.0.0.1]:47842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3dU5-00087A-7H for importer@patchew.org; Tue, 12 Mar 2019 05:14:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3dCF-0001cy-0e for qemu-devel@nongnu.org; Tue, 12 Mar 2019 04:55:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3dCD-0001ZU-RC for qemu-devel@nongnu.org; Tue, 12 Mar 2019 04:55:38 -0400 Received: from ozlabs.org ([203.11.71.1]:40631) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3dCD-0001OV-Bg; Tue, 12 Mar 2019 04:55:37 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 44JTMK2CLlz9sNy; Tue, 12 Mar 2019 19:55:25 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1552380925; bh=VMO/Zhzw4HeuR3K80BXH37ri6fuDg8EhFGofHgHXSJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=THKTReRkIKBHhzgyAVFC+EBOhhlkRZRteTeS4B35YXA47SJx1Lcrk4kdT8fpICawS uzXuT8QuzbaS+aZK7CSoc+b4lz88KL+82zGCLVbuPUzmXZcyhojfimbKAGyvxpXq6R z1+qTP3/L4eAmC1j2tPB+RNNgYlOxjuIekcYT0PM= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Mar 2019 19:54:13 +1100 Message-Id: <20190312085502.8203-14-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190312085502.8203-1-david@gibson.dropbear.id.au> References: <20190312085502.8203-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 13/62] target/ppc: Move exception vector offset computation into a function 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: lvivier@redhat.com, Fabiano Rosas , Alexey Kardashevskiy , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Fabiano Rosas Signed-off-by: Fabiano Rosas Reviewed-by: Alexey Kardashevskiy Message-Id: <20190228225759.21328-2-farosas@linux.ibm.com> Signed-off-by: David Gibson --- target/ppc/excp_helper.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 39bedbb11d..beafcf1ebd 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -107,6 +107,24 @@ static int powerpc_reset_wakeup(CPUState *cs, CPUPPCSt= ate *env, int excp, return POWERPC_EXCP_RESET; } =20 +static uint64_t ppc_excp_vector_offset(CPUState *cs, int ail) +{ + uint64_t offset =3D 0; + + switch (ail) { + case AIL_0001_8000: + offset =3D 0x18000; + break; + case AIL_C000_0000_0000_4000: + offset =3D 0xc000000000004000ull; + break; + default: + cpu_abort(cs, "Invalid AIL combination %d\n", ail); + break; + } + + return offset; +} =20 /* Note that this function should be greatly optimized * when called with a constant excp, from ppc_hw_interrupt @@ -708,17 +726,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int e= xcp_model, int excp) /* Handle AIL */ if (ail) { new_msr |=3D (1 << MSR_IR) | (1 << MSR_DR); - switch(ail) { - case AIL_0001_8000: - vector |=3D 0x18000; - break; - case AIL_C000_0000_0000_4000: - vector |=3D 0xc000000000004000ull; - break; - default: - cpu_abort(cs, "Invalid AIL combination %d\n", ail); - break; - } + vector |=3D ppc_excp_vector_offset(cs, ail); } =20 #if defined(TARGET_PPC64) --=20 2.20.1