From patchwork Tue Feb 26 03:05:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 10829357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16B8215AC for ; Tue, 26 Feb 2019 03:07:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 043F52A924 for ; Tue, 26 Feb 2019 03:07:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC1D52A9F8; Tue, 26 Feb 2019 03:07:19 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A29C62A924 for ; Tue, 26 Feb 2019 03:07:19 +0000 (UTC) Received: from localhost ([127.0.0.1]:47468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyT5S-0004gG-Ud for patchwork-qemu-devel@patchwork.kernel.org; Mon, 25 Feb 2019 22:07:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyT4F-0003qe-Rq for qemu-devel@nongnu.org; Mon, 25 Feb 2019 22:06:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyT4F-0007hs-3g for qemu-devel@nongnu.org; Mon, 25 Feb 2019 22:06:03 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:41206) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gyT4D-0007gK-F0; Mon, 25 Feb 2019 22:06:01 -0500 Received: by mail-pl1-x643.google.com with SMTP id y5so5480596plk.8; Mon, 25 Feb 2019 19:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RP4PmwQRzdsB1yZhZry1b6YePNqWvjkg4wt30WSqpRg=; b=SjM5h0O5sLjmN8QTM1Tac88B/Zo1hjMSxVWWSi7sZmwxhDTcliQyHYTV8xMj1fO2Ih nF3YPHGi+vK69WO4sPrMlOT8h4sxmRpsJSJwBRyOXxt9vv+lr3v01p9VvgS9goktu8Zc tg1NtSW0W60WcPvhe2FIghn5UsPTlBIaFnilbqxKoi2enw1VjZuBQ9FzTSieFGXmYCme wlKuNrALiebGUxqmibLMUHrJTGV6dMBe7H4evRYUUXmJuWHKnWiB/AV/IZi0Sepfc+xt ZRaEqPWI/YuV7H4F0ncSCxCBffeuSVT82UrezndH9st4pgXz/PaS9gZeRLaZyIOpkwQh 1P/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RP4PmwQRzdsB1yZhZry1b6YePNqWvjkg4wt30WSqpRg=; b=Az+ia35u3hgpKQdWyOS8bIvupTHh8oywAyhqt7LNp9nDI/j2OmwXLTuUESlwjnbIU9 8bizrRO6Yaf0oe7FR4zff+6Lmv+HZ87gN1aziNdMEindxI47LVoq9xA7QLP0wH4lBnQw uwLlMndYqNMZlQrmoS6Q5wvf467AIkVfsU+aoI7hNHRlY9EK1yY90pI0CtmOWN5j3AQV Gyv7NLegmMNgXBSeF8LhDC1jPDg1vtUPZse7p9A3BMiEJp4dkNvleUm5eYY/2LuMLbHo lvA6lxvb/MZ22fpg4OA0TEw8Hht1HADVmGXgWS07VP1o0i9VTh2Y55Nwj1PmEW+IYLxi h6HQ== X-Gm-Message-State: AHQUAua4QDzZARzwrTuoduYYb2ySb0u80/9z7joyyMTHxPUC8CgkOkoT 2+OwGMGMo5G19u4M4ZrPQKUwpZjd X-Google-Smtp-Source: AHgI3IaSXWprnR6DAP3vozVGzdJLT+ytskBvEsj+iNpqQMNA3Yh70WPhEaEiI/aV5vOJdMwHhMKn+A== X-Received: by 2002:a17:902:8692:: with SMTP id g18mr23294403plo.149.1551150358823; Mon, 25 Feb 2019 19:05:58 -0800 (PST) Received: from surajjs2.ozlabs.ibm.com.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id j1sm4427825pgp.84.2019.02.25.19.05.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Feb 2019 19:05:58 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Tue, 26 Feb 2019 14:05:31 +1100 Message-Id: <20190226030531.9932-4-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190226030531.9932-1-sjitindarsingh@gmail.com> References: <20190226030531.9932-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::643 Subject: [Qemu-devel] [QEMU-PPC] [PATCH 4/4] target/ppc/spapr: Enable the large decrementer by default on POWER9 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: qemu-devel@nongnu.org, clg@kaod.org, Suraj Jitindar Singh , 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 Enable the large decrementer by default on POWER9 cpu models. The default value applied is that provided in the cpu class. Signed-off-by: Suraj Jitindar Singh --- hw/ppc/spapr_caps.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index e07568fb94..f48aa367e3 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -566,11 +566,18 @@ sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] = { static sPAPRCapabilities default_caps_with_cpu(sPAPRMachineState *spapr, const char *cputype) { + PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(object_class_by_name(cputype)); sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr); sPAPRCapabilities caps; caps = smc->default_caps; + caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = pcc->hdecr_bits; + if (!ppc_type_check_compat(cputype, CPU_POWERPC_LOGICAL_3_00, + 0, spapr->max_compat_pvr)) { + caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = 0; + } + if (!ppc_type_check_compat(cputype, CPU_POWERPC_LOGICAL_2_07, 0, spapr->max_compat_pvr)) { caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF;