Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp581385ybt; Fri, 19 Jun 2020 08:38:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqKhUq1f4oUptsbB7BIqroJe7qZkQMRPVG18pD0uPqrDF6WWcfRz9jbc9/crNqFw7jLvV5 X-Received: by 2002:a17:906:fcb7:: with SMTP id qw23mr3920101ejb.229.1592581112721; Fri, 19 Jun 2020 08:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592581112; cv=none; d=google.com; s=arc-20160816; b=pEKTeJAvEhG6evhhNXOpyv7wMLACbLWVGM+J+FMAR9dqgSbH1hTPJ4cGg/7NzMraS4 RunDwir0B6nlOxV8OU8HuSq252BwNoVTm1lDvB6YoXH0tToNmnfG8+rboC4QRjWl96/j oJRmAEfw0efKGWZIb3fvLulRkGPPGXTWNp25Wr563BDzf0ejoETPntVRHWJk0As2gCPQ klrk1LsI5U8jr+W8si5yTLuDS0s1Jn9pbDshMRuqXnvm2WzdGcbixzXiRcxDJ45Dnld6 pMU8HTjaYgBHIK4HfrHvoCXxaDLtARbwTvi8gJJWTNQ7bJJTFhKdb6CspEietK9PdQuq I02A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OsLE3cYG06X3+blhI8FiKelDduqt8MroUI86Mi7fW8c=; b=MpWKxDhMrTgupVI0DacOs8FP77+eqZXP85m/gJ4mJtSwLILMwCo7TlVhJ06H+2SBem SgeeCYOwbRnRXRs3s+eRtYceXbuvtRDwqV/k6qG+czU4k7S57y1Pf41L06xZSZz3SUed ZDaCXAdo1Yc/M+0JUKhO5iJn7vFxFkie8kqwVehd5xbBQTNj3w8fFyM+cIPvZSxJJmuo C6EijtVcEMnRtncmhZMU2O2V0cDsC9Eo0uZwt1QJRCaqFDI0JQteOI7ilXHMrNocu0Fp SguTl8ZvnVeGH1ALqIocaM1zbC2GtE9SDSGX5Hl2zyGOXx2GLeD7XCfEITX/R1929FOk uqCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="qB1l/4nk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x11si3893155ejb.614.2020.06.19.08.38.10; Fri, 19 Jun 2020 08:38:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="qB1l/4nk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393017AbgFSPdh (ORCPT + 99 others); Fri, 19 Jun 2020 11:33:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:37120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404939AbgFSPdI (ORCPT ); Fri, 19 Jun 2020 11:33:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E3B582166E; Fri, 19 Jun 2020 15:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580787; bh=eDxLH4ouDqLNWQDr9hjpdo2YNXdlxYjycEeNZepbj/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qB1l/4nkd9ytutk2NFY6D40kEZSm7JhdmJ0ugO9N//SwrFFaOMnwBoh94W/0bmGK/ 5AqaomU3oBpb3aWGwUBFJl8zSlHsS/P+4WLhlZ+k/+XXf84radF6n5UE73FfINnfwW USdigQb6/2GxQ2xzDw7eUFOj54pBDMgtfayK7RkU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman Subject: [PATCH 5.7 342/376] powerpc/64s: Dont let DT CPU features set FSCR_DSCR Date: Fri, 19 Jun 2020 16:34:20 +0200 Message-Id: <20200619141726.521924280@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Ellerman commit 993e3d96fd08c3ebf7566e43be9b8cd622063e6d upstream. The device tree CPU features binding includes FSCR bit numbers which Linux is instructed to set by firmware. Whether that's a good idea or not, in the case of the DSCR the Linux implementation has a hard requirement that the FSCR_DSCR bit not be set by default. We use it to track when a process reads/writes to DSCR, so it must be clear to begin with. So if firmware tells us to set FSCR_DSCR we must ignore it. Currently this does not cause a bug in our DSCR handling because the value of FSCR that the device tree CPU features code establishes is only used by swapper. All other tasks use the value hard coded in init_task.thread.fscr. However we'd like to fix that in a future commit, at which point this will become necessary. Fixes: 5a61ef74f269 ("powerpc/64s: Support new device tree binding for discovering CPU features") Cc: stable@vger.kernel.org # v4.12+ Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200527145843.2761782-2-mpe@ellerman.id.au Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/dt_cpu_ftrs.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/arch/powerpc/kernel/dt_cpu_ftrs.c +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c @@ -346,6 +346,14 @@ static int __init feat_enable_dscr(struc { u64 lpcr; + /* + * Linux relies on FSCR[DSCR] being clear, so that we can take the + * facility unavailable interrupt and track the task's usage of DSCR. + * See facility_unavailable_exception(). + * Clear the bit here so that feat_enable() doesn't set it. + */ + f->fscr_bit_nr = -1; + feat_enable(f); lpcr = mfspr(SPRN_LPCR);