From patchwork Fri Mar 1 02:43:17 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: 10834363 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 8A21D1515 for ; Fri, 1 Mar 2019 02:45:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 798D12FBAD for ; Fri, 1 Mar 2019 02:45:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 760842FBDE; Fri, 1 Mar 2019 02:45:09 +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 1A4A82FBAD for ; Fri, 1 Mar 2019 02:45:09 +0000 (UTC) Received: from localhost ([127.0.0.1]:49676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzYAe-0003R3-9r for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Feb 2019 21:45:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzY9O-0002O4-5C for qemu-devel@nongnu.org; Thu, 28 Feb 2019 21:43:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzY9N-0000uv-CY for qemu-devel@nongnu.org; Thu, 28 Feb 2019 21:43:50 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:34581) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzY9L-0000sl-Jn; Thu, 28 Feb 2019 21:43:47 -0500 Received: by mail-pf1-x42b.google.com with SMTP id u9so10692298pfn.1; Thu, 28 Feb 2019 18:43:47 -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=p8XqU8xrkhsPIx6P454hv5fQ5JOG85y38aIu7k7PVQo=; b=Z/IXSkaGll8Kxqxu4OvclnwHPo+3TSs0AktR7PL2TQEQciKk1SKm5rqzQhYWhNR4v9 m7tuoGcMpYu69Opfvmd4zNNXAmSJOXW8mADX+DyOADJSB+kERsIa5o8uWuB+BhYJYXaT h4NJko2gWyrmATRWXURu7BcmojfqKxgsF4gyVjIuLC3kjMoGfcRNVA6GfVfphWYZUxRI oYtjYUDma8hieEsC/C4L3RZgC6PUPjnqk0AzXkGY+FiGak04dRoPSEvbyT2H3a89Rqsi PuYPXUUOfMo6PdmXladqZ7RH0bIDkhyvAPWQPjljSrwzkGjx6S607mSifGTOx3uvXL41 APHg== 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=p8XqU8xrkhsPIx6P454hv5fQ5JOG85y38aIu7k7PVQo=; b=bpctdX7POWmG8fZCOgFp9uErLPGyVlnX+O8rqZVu15Eb9mvUy7OdIZcZuBGZ9a2eJ5 FbY0v4KV3H+mFdbF+8aRYSs2zzc5wux0N5o/vyPZghoLcPfhR75x/AB9dPHZXx9DQMOf eVs/mH4TWpT6/UnABvYE6JGJxdn0W2eM59B3volzUVOTx5IQ/tnD2lzZVPitNPQZqLwq ve8gfYjG7ijKKPchWzThRtkbtvLaNKMBR4Bb+ythNyn0AWD/fOcl4PnsPInK/dPtE1kR dLoNh/UXYeU+EoiB1+2CQWo9OqO/8x7n1HalLsWDCJ+HairfaMbEI1Q8T9kma+JcXyV4 6gww== X-Gm-Message-State: APjAAAXnSScejJQ/5vmTCek1K8lMNRd9Z1cwCqkFmriK7aGijV/ytfJD 7ExfyRFfXBz+wmxAZmcXXT8e1xCG X-Google-Smtp-Source: APXvYqx8eEKXcNPYlZ8PpIyX4DjXdQrphLYNiZmtHb274S5ddSIPCAiWurkw93xftXJhWTbPNxoXfg== X-Received: by 2002:a63:2bd5:: with SMTP id r204mr2604430pgr.48.1551408226490; Thu, 28 Feb 2019 18:43:46 -0800 (PST) Received: from surajjs2.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id n25sm46929179pfi.173.2019.02.28.18.43.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 18:43:45 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Fri, 1 Mar 2019 13:43:17 +1100 Message-Id: <20190301024317.22137-4-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190301024317.22137-1-sjitindarsingh@gmail.com> References: <20190301024317.22137-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::42b Subject: [Qemu-devel] [QEMU-PPC] [PATCH v3 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, 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 9942b270df..1df324379f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4318,7 +4318,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] = SPAPR_CAP_OFF; + smc->default_caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = SPAPR_CAP_ON; spapr_caps_add_properties(smc, &error_abort); smc->irq = &spapr_irq_xics; smc->dr_phb_enabled = true; @@ -4394,6 +4394,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] = SPAPR_CAP_OFF; } DEFINE_SPAPR_MACHINE(3_1, "3.1", false); diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 1e76685199..920224d0c2 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] = SPAPR_CAP_OFF; + } + if (!ppc_type_check_compat(cputype, CPU_POWERPC_LOGICAL_2_07, 0, spapr->max_compat_pvr)) { caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF;