From patchwork Tue Jun 7 15:39:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9161699 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 6B82D60572 for ; Tue, 7 Jun 2016 15:40:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CBF01FFBD for ; Tue, 7 Jun 2016 15:40:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5095527248; Tue, 7 Jun 2016 15:40:38 +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 D96B71FFBD for ; Tue, 7 Jun 2016 15:40:37 +0000 (UTC) Received: from localhost ([::1]:51060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAJ7M-0001so-HX for patchwork-qemu-devel@patchwork.kernel.org; Tue, 07 Jun 2016 11:40:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAJ6n-0001oQ-6i for qemu-devel@nongnu.org; Tue, 07 Jun 2016 11:40:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAJ6f-0002g6-Me for qemu-devel@nongnu.org; Tue, 07 Jun 2016 11:40:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAJ6f-0002fl-GZ; Tue, 07 Jun 2016 11:39:53 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0044C04B300; Tue, 7 Jun 2016 15:39:52 +0000 (UTC) Received: from thh440s.fritz.box (vpn1-4-220.ams2.redhat.com [10.36.4.220]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u57FdfGU021203; Tue, 7 Jun 2016 11:39:51 -0400 From: Thomas Huth To: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Date: Tue, 7 Jun 2016 17:39:40 +0200 Message-Id: <1465313980-31281-6-git-send-email-thuth@redhat.com> In-Reply-To: <1465313980-31281-1-git-send-email-thuth@redhat.com> References: <1465313980-31281-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 07 Jun 2016 15:39:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 5/5] ppc: Add PowerISA 2.07 compatibility mode 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: Alexey Kardashevskiy , agraf@suse.de, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Make sure that guests can use the PowerISA 2.07 CPU sPAPR compatibility mode when they request it and the target CPU supports it. Signed-off-by: Thomas Huth --- hw/ppc/spapr_hcall.c | 6 ++++-- target-ppc/translate_init.c | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index cc16249..2ba5cbd 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -927,7 +927,7 @@ static void cas_handle_compat_cpu(PowerPCCPUClass *pcc, uint32_t pvr, unsigned *cpu_version) { unsigned lvl = get_compat_level(pvr); - bool is205, is206; + bool is205, is206, is207; if (!lvl) { return; @@ -939,8 +939,10 @@ static void cas_handle_compat_cpu(PowerPCCPUClass *pcc, uint32_t pvr, is206 = (pcc->pcr_supported & PCR_COMPAT_2_06) && ((lvl == get_compat_level(CPU_POWERPC_LOGICAL_2_06)) || (lvl == get_compat_level(CPU_POWERPC_LOGICAL_2_06_PLUS))); + is207 = (pcc->pcr_supported & PCR_COMPAT_2_07) && + (lvl == get_compat_level(CPU_POWERPC_LOGICAL_2_07)); - if (is205 || is206) { + if (is205 || is206 || is207) { if (!max_lvl) { /* User did not set the level, choose the highest */ if (*compat_lvl <= lvl) { diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index ee2bc14..46fa375 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -9532,6 +9532,9 @@ void ppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version, Error **errp) case CPU_POWERPC_LOGICAL_2_06_PLUS: env->spr[SPR_PCR] = PCR_TM_DIS | PCR_COMPAT_2_07 | PCR_COMPAT_2_06; break; + case CPU_POWERPC_LOGICAL_2_07: + env->spr[SPR_PCR] = PCR_COMPAT_2_07; + break; default: env->spr[SPR_PCR] = 0; break;