From patchwork Wed Feb 27 04:30:08 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: 10831045 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 23D6D13B5 for ; Wed, 27 Feb 2019 04:32:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EA4A2D1FF for ; Wed, 27 Feb 2019 04:32:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 016812D209; Wed, 27 Feb 2019 04:32:21 +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 9CDD92D1FF for ; Wed, 27 Feb 2019 04:32:21 +0000 (UTC) Received: from localhost ([127.0.0.1]:37731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyqtI-0001im-RU for patchwork-qemu-devel@patchwork.kernel.org; Tue, 26 Feb 2019 23:32:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyqrj-0000fg-1k for qemu-devel@nongnu.org; Tue, 26 Feb 2019 23:30:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyqrh-0008Tn-50 for qemu-devel@nongnu.org; Tue, 26 Feb 2019 23:30:42 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:42650) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gyqre-0008EB-Gv; Tue, 26 Feb 2019 23:30:38 -0500 Received: by mail-pl1-x636.google.com with SMTP id v11so1916091plg.9; Tue, 26 Feb 2019 20:30:29 -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=hDS45rUlD2G2PkXn682BysQkY5AvQdxmLuVDOsB6cqM=; b=rR3pZtohu00yXoyi1Yf70kPGSY30elg8T6raAmQos/lL00DcKfMo3VBTblYtqM9kbD MU207nhQrEaGwm5QXo8M/cCnXtTeywVKXvEPNYa1+Bq+QhIIsnabFqicjgzHPq5SHJdm 7DK9bgY5i8DQ7Tsd6Any5Pts+Zz0sHChaOEfwf87VsJQ39kmdNsviPF+dtT/fN+XHL5c kXowlEdeol4b/YU3H6IfuwVfADy8Q51berSN01XX3qdE2XOBbJJxs3oLegMIse5TqmD8 7B7e9VAxQabR7Pjv+SP7XPEFFH4CXiDutYqyja3QgKoPrRazTAXZvQP8X9dSgOiAhiDn vcWA== 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=hDS45rUlD2G2PkXn682BysQkY5AvQdxmLuVDOsB6cqM=; b=SMb/nUdnYfvuvHYb+1dkqUVviUVm9ZrsPeWqYCWMRLqW8p4dGnVy71AYEHLNJWnXCC WaRUJZW8wOKMuw2k2JvCg0c+LdtBpb4vdqE5MBBGj0vtqojmvzhQDsM9dlSRJ8O2z7/r LMDk4K8jUoxV2rzp4DHA59PX8Sojs8LTDmtstzllcoBPKSZ6422nbPdGAPDTBJMXGib6 dFmRgAeBR/UJG8PMsOA6CWCVDaZaZvjO2tuzvBLmheRlskymtJXcKVXm3p8O8/Qgqd8i Wdpqam2P8g4iGCoJ1N7bIbK1BNkHKhmakY9nDI0PzFzsA5QnhTEOP/83pdk/LQUopJKG 8dFw== X-Gm-Message-State: AHQUAuYFP8wt5CjklVfdm97BXnWICKX6zsB1tqSkhFZbQN7+SsSuXlHr iuuZZNwnzNYSdlvkNQKxcCsTdDgG X-Google-Smtp-Source: AHgI3IaH9twT6OUfiUXUIgtOxYEiNdqXqI3O2EhyRp+pA9cEcPSaKFbbkm2/4U4ohI7pumuTn4BfcA== X-Received: by 2002:a17:902:7688:: with SMTP id m8mr112355pll.248.1551241828223; Tue, 26 Feb 2019 20:30:28 -0800 (PST) Received: from localhost.au.ibm.com ([43.245.162.131]) by smtp.gmail.com with ESMTPSA id k18sm9203642pfj.92.2019.02.26.20.30.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 20:30:27 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Wed, 27 Feb 2019 15:30:08 +1100 Message-Id: <20190227043008.12059-4-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190227043008.12059-1-sjitindarsingh@gmail.com> References: <20190227043008.12059-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::636 Subject: [Qemu-devel] [QEMU-PPC] [PATCH v2 4/4] target/ppc/spapr: Enable the large decrementer for pseries-4.0 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 for the pseries-4.0 machine type. It is disabled again by default_caps_with_cpu() for pre-POWER9 cpus since they don't support the large decrementer. Signed-off-by: Suraj Jitindar Singh --- hw/ppc/spapr.c | 3 ++- hw/ppc/spapr_caps.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ff5ba59cc0..bbfaca3b05 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4297,7 +4297,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_BROKEN; smc->default_caps.caps[SPAPR_CAP_HPT_MAXPAGESIZE] = 16; /* 64kiB */ smc->default_caps.caps[SPAPR_CAP_NESTED_KVM_HV] = SPAPR_CAP_OFF; - smc->default_caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = 0; + smc->default_caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = 1; spapr_caps_add_properties(smc, &error_abort); smc->irq = &spapr_irq_xics; smc->dr_phb_enabled = true; @@ -4373,6 +4373,7 @@ static void spapr_machine_3_1_class_options(MachineClass *mc) mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power8_v2.0"); smc->update_dt_enabled = false; smc->dr_phb_enabled = false; + smc->default_caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = 0; } DEFINE_SPAPR_MACHINE(3_1, "3.1", false); diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 1e76685199..fbd5d35cd0 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -536,6 +536,11 @@ static sPAPRCapabilities default_caps_with_cpu(sPAPRMachineState *spapr, caps = smc->default_caps; + 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;