Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp439716imm; Sat, 22 Sep 2018 03:33:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV62RO3UuNBpYed+EHZbtckIX6zgfAUOoJMAaBORJC9SVLaNcbGSNiysRY9kjgPslpekINJtU X-Received: by 2002:a17:902:4324:: with SMTP id i33-v6mr2033534pld.43.1537612438901; Sat, 22 Sep 2018 03:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537612438; cv=none; d=google.com; s=arc-20160816; b=eiEmGznSXxc6sybErP8skMXhq8ErxZbXjQThMKjXkgQbJ6MwSkO0MemqmPpVQaJcpx 8LqUjfj7tYi0jG6lJjOmZ1jzmy6kJ4t65i3oQw6Yp5gvziU8d3ePiTO1hNvVurpfUElI XtAY9ecW7V4mp+1AylVo2bC2xShr6VD2Dx1eRiRJGT6iih9VU6odOjWOgg3z4Fq2Tvuk TlWP42bCjRlqNSzPYFOXbbKFwev0oclt9w8nOWb+MAIRAOpeQ64dxKe65UXFiJfpVsP4 FUbF3ZnAKRZFPJaZ1ohyDUKUML9R/mb0OwYx+hGsEZlS4mdUvoPgLr7cML3Zx+IFseSn 30bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MUQuhqbj8YaLwpMgcVkNJVLIhUKBC1qSIGs7I1DQwD4=; b=QZ8mlwwVgYstdlALFwchHDc7q8tOOFti/9WdkEQJXVBoZrHExPO5Gz4B+lLiicMwIw Scwz3jKXUpkE/T+ZAUXkXXCvPpElQndkaZenxSGJpH3G6jQkTMK7v/O0rRYCLnPf1AWK s01QR8KLUVZHijLIyEvG+4ngRHehz4XCYiSc0GnNUpfDc+w/G4HITWfrK7VrA0TrPwH/ ZZXz8b0c6brWoXMNg1EVn2HQXtJNg/CDJbzF2+t5UmNcD33YzJiQDnhPjCPJXY4zp+2j 9li78e4FnYkz0FvF+PS91qX/e8DanOC6p8wpWu6IGtc+q8gR1/RYwcNNLwH/CLQNY746 Pcjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=hlYakf6y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10-v6si26531719pgn.444.2018.09.22.03.33.42; Sat, 22 Sep 2018 03:33:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=hlYakf6y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728164AbeIVQ0Z (ORCPT + 99 others); Sat, 22 Sep 2018 12:26:25 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49972 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbeIVQ0Z (ORCPT ); Sat, 22 Sep 2018 12:26:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MUQuhqbj8YaLwpMgcVkNJVLIhUKBC1qSIGs7I1DQwD4=; b=hlYakf6yCL3L98J9m/DXEaj4h LVAwHzueYqegzb4uJ+kfe1dMBDWXGHHvDtTn93axfzunUJQ0kYGa2NVnMMDkUo4Wm/n9WFCozQMmY vN/deQGwZgrlvYMvNk9L5Im1Ld9VqmwbVBszfEHGizWvZqUOaQEeA86wvMoEn7aNv48NEAYbAfjPu 0gbLNqCeZV6saY+xzGNPVQCQo0vDiOjooDXj7ecJTlypp7iz6upHRQ2bG8c+blYfPXrOts3bXnvfa IMynSFNjvVXDoHNgrdZ0VheWffXwBWGTgtaDmHjS/LsR0w4ixcmPbK2m7MDT3FbWROtAbDhCh+2WS k2bEgvSpw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3fDy-0004eW-7z; Sat, 22 Sep 2018 10:33:18 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A17E92025483B; Sat, 22 Sep 2018 12:33:16 +0200 (CEST) Date: Sat, 22 Sep 2018 12:33:16 +0200 From: Peter Zijlstra To: Dave Hansen Cc: Thomas Gleixner , LKML , x86@kernel.org, Bin Yang , Mark Gross , Ingo Molnar Subject: Re: [patch V3 05/11] x86/mm/cpa: Add debug mechanism Message-ID: <20180922103316.GH24124@hirez.programming.kicks-ass.net> References: <20180917142906.384767038@linutronix.de> <20180917143546.078998733@linutronix.de> <24b0749f-d472-bd6b-4397-e59e01b3a9df@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24b0749f-d472-bd6b-4397-e59e01b3a9df@intel.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 21, 2018 at 09:40:36AM -0700, Dave Hansen wrote: > On 09/17/2018 07:29 AM, Thomas Gleixner wrote: > > The whole static protection magic is silently fixing up anything which is > > handed in. That's just wrong. The offending call sites need to be fixed. > > > > Add a debug mechanism which emits a warning if a requested mapping needs to be > > fixed up. The DETECT debug mechanism is really not meant to be enabled except > > for developers, so limit the output hard to the protection fixups. > ... > > +enum cpa_warn { > > + CPA_PROTECT, > > + CPA_DETECT, > > +}; > > + > > +static const int cpa_warn_level = CPA_PROTECT; > > Even if this is intended for developers only, should we also add some > config option here so things like 0day can still get warnings out of this? > > Reviewed-by: Dave Hansen OTOH, I really wish there was something like: depends !RANDCONFIG for some of those things, because I triggered GCC_PLUGIN_STRUCTLEAK_VERBOSE in a randconfig the other day and thought everything was busted due to the massive output.