From patchwork Mon Jun 5 10:46:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 9766051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 16BBE602BF for ; Mon, 5 Jun 2017 10:46:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC07E27CAF for ; Mon, 5 Jun 2017 10:46:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CED5227F8F; Mon, 5 Jun 2017 10:46:40 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4B40027CAF for ; Mon, 5 Jun 2017 10:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZaEq1Q6JA3Pw3jTC9ZTEPXOMzyQcTnrvr4Lrjnum0UQ=; b=CtkvhFtzswjbJL epSz6st9YnorQ9GfRpH+5vQY49NtDzanbtzMXmq6kJAVlCd+Wu2R3qSotZ38BogYyHHo+zk4x2+f8 Xwqxaj0ytdhx53/2i9s/9uxhWID90WKvGGXdo84NAjX9Xa278YlqS/tq8HUez15pwWDEdE4tRzCOJ zdKnWTiBp/IRLd1tvgmOn/RJg/gAK5XEMAkCJyD4oa6E4rU2ijojW1gceTouUI/PzOwCbvbXVIxoW oeNoqL8Yg+FBkSrQh8N3K7Wd8sRRHB7MSQMHk4t7cG5yGH47qqbQIym29h75tttr6gCmefDf8LtSp VnIQ+ghS2uRKkRBkfcfw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dHpWv-0002sF-1Q; Mon, 05 Jun 2017 10:46:37 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dHpWr-0002qf-OJ for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2017 10:46:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 834B62B; Mon, 5 Jun 2017 03:46:13 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 537A43F578; Mon, 5 Jun 2017 03:46:13 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 7F76A1AE0DB9; Mon, 5 Jun 2017 11:46:20 +0100 (BST) Date: Mon, 5 Jun 2017 11:46:20 +0100 From: Will Deacon To: Heiner Kallweit Subject: Re: Small issue with 3fde2999fac5 "arm64: cpufeature: Don't dump useless backtrace on CPU_OUT_OF_SPEC" Message-ID: <20170605104620.GC21944@arm.com> References: <7f8ade0a-c4ab-3e2e-d21e-8eab4df07cac@gmail.com> <20170605084840.GB4650@leverpostej> <8ff72bb8-d8be-e691-c939-5f7d73f5e3d9@gmail.com> <20170605092438.GE4650@leverpostej> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170605_034633_797602_9618B5BE X-CRM114-Status: GOOD ( 20.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jun 05, 2017 at 11:37:35AM +0200, Heiner Kallweit wrote: > Am 05.06.2017 um 11:24 schrieb Mark Rutland: > > On Mon, Jun 05, 2017 at 11:20:53AM +0200, Heiner Kallweit wrote: > >> Am 05.06.2017 um 10:48 schrieb Mark Rutland: > >>> Hi, > >>> > >>> On Sun, Jun 04, 2017 at 02:53:36PM +0200, Heiner Kallweit wrote: > >>>> The warning is printed unconditionally. An "if (taint)" seems to be > >>>> missing. > >>> > >>> I'm not sure I follow. We're using pr_warn_once(), which should only > >>> print the message once, regardless of how many times it is called. > >>> > >> Before we had WARN_TAINT_ONCE(taint, ..), so the warning is > >> triggered by taint != 0. > >> Now the warning is printed (just once but) even if taint == 0. > > > > Ah, I see. > > > > Thanks for the report; I'll put together a fix shortly. > > > > Do you mind if I add: > > > > Reported-by: Heiner Kallweit > > > Fine with me. I'm about to apply the patch below. Will --->8 From 8dd0ee651d8aefdc2d8ae0fcc9c68dfc943c9e4c Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Mon, 5 Jun 2017 11:40:23 +0100 Subject: [PATCH] arm64: cpufeature: Fix CPU_OUT_OF_SPEC taint for uniform systems Commit 3fde2999fac5 ("arm64: cpufeature: Don't dump useless backtrace on CPU_OUT_OF_SPEC") changed the cpufeature detection code to use add_taint instead of WARN_TAINT_ONCE when detecting a heterogeneous system with mismatched feature support. Unfortunately, this resulted in all systems getting the taint, regardless of any feature mismatch. This patch fixes the problem by conditionalising the taint on detecting a feature mismatch. Acked-by: Mark Rutland Reported-by: Heiner Kallweit Signed-off-by: Will Deacon --- arch/arm64/kernel/cpufeature.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 22f554320581..55d5c72a507d 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -639,8 +639,10 @@ void update_cpu_features(int cpu, * Mismatched CPU features are a recipe for disaster. Don't even * pretend to support them. */ - pr_warn_once("Unsupported CPU feature variation detected.\n"); - add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK); + if (taint) { + pr_warn_once("Unsupported CPU feature variation detected.\n"); + add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK); + } } u64 read_sanitised_ftr_reg(u32 id)