From patchwork Thu Oct 12 10:17:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 824767 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yCRkl3rgcz9sRq for ; Thu, 12 Oct 2017 21:23:11 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yCRkl2w03zDrVf for ; Thu, 12 Oct 2017 21:23:11 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yCRcp2rcQzDr8M for ; Thu, 12 Oct 2017 21:18:02 +1100 (AEDT) Received: by ozlabs.org (Postfix, from userid 1034) id 3yCRcn6ybTz9t38; Thu, 12 Oct 2017 21:18:01 +1100 (AEDT) From: Michael Ellerman To: skiboot@lists.ozlabs.org Date: Thu, 12 Oct 2017 21:17:58 +1100 Message-Id: <1507803478-13591-1-git-send-email-mpe@ellerman.id.au> X-Mailer: git-send-email 2.7.4 Subject: [Skiboot] [PATCH] cpu: Add OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Add a new CPU reinit flag, "TM Suspend Disabled", which requests that CPUs be configured so that TM (Transactional Memory) suspend mode is disabled. Currently this always fails, because skiboot has no way to query the state. A future hostboot change will add a mechanism for skiboot to determine the status and return an appropriate error code. Signed-off-by: Michael Ellerman --- core/cpu.c | 10 ++++++++++ doc/opal-api/opal-reinit-cpus-70.rst | 8 ++++++++ include/opal-api.h | 2 ++ 3 files changed, 20 insertions(+) diff --git a/core/cpu.c b/core/cpu.c index 78565b5afec9..c459aba6d84a 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -1373,6 +1373,16 @@ static int64_t opal_reinit_cpus(uint64_t flags) flags &= ~(OPAL_REINIT_CPUS_HILE_BE | OPAL_REINIT_CPUS_HILE_LE); } + if (flags & OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED) { + flags &= ~OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED; + + /* + * Pending a hostboot change we can't determine the status of + * this, so it always fails. + */ + rc = OPAL_UNSUPPORTED; + } + /* Handle P8 DD1 SLW reinit */ if (flags != 0 && proc_gen == proc_gen_p8 && !hile_supported) rc = slw_reinit(flags); diff --git a/doc/opal-api/opal-reinit-cpus-70.rst b/doc/opal-api/opal-reinit-cpus-70.rst index 0eb670447f80..bee350d55f88 100644 --- a/doc/opal-api/opal-reinit-cpus-70.rst +++ b/doc/opal-api/opal-reinit-cpus-70.rst @@ -17,6 +17,7 @@ Currently, possible flags are: :: OPAL_REINIT_CPUS_HILE_LE = (1 << 1), OPAL_REINIT_CPUS_MMU_HASH = (1 << 2), OPAL_REINIT_CPUS_MMU_RADIX = (1 << 3), + OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED = (1 << 4), }; Extra flags may be added in the future, so other bits *must* be 0. @@ -30,6 +31,13 @@ are support and other bits *MUST NOT* be set. On POWER9 CPUs, all options including OPAL_REINIT_CPUS_MMU_HASH and OPAL_REINIT_CPUS_MMU_RADIX. +OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This flag requests that CPUs be configured with TM (Transactional Memory) +suspend mode disabled. This may only be supported on some CPU versions. + + Returns ------- diff --git a/include/opal-api.h b/include/opal-api.h index 0ff0db0254f8..0bc036ed7a52 100644 --- a/include/opal-api.h +++ b/include/opal-api.h @@ -1033,6 +1033,8 @@ enum { */ OPAL_REINIT_CPUS_MMU_HASH = (1 << 2), OPAL_REINIT_CPUS_MMU_RADIX = (1 << 3), + + OPAL_REINIT_CPUS_TM_SUSPEND_DISABLED = (1 << 4), }; typedef struct oppanel_line {