Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1429081imm; Tue, 15 May 2018 20:11:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqeZQ1YVbqC0tZPf6VW/sV3xF6O0zt2u+5ol8voncU9/m5p2FWe5es288AyIt3+TIXIkqFG X-Received: by 2002:a17:902:7841:: with SMTP id e1-v6mr17467904pln.197.1526440302336; Tue, 15 May 2018 20:11:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526440302; cv=none; d=google.com; s=arc-20160816; b=WFjPUQDdltmuXZ9cPt9jpgfpB2tm+eiUSA2eUgWdzjiX465WtAFASvcbUBb+xk92Kg Se3C45K5dtfvzfXefHo7Q6LqJmJQQcfwBMhA7kK8g+rFMjag4A70fgldUGEmZvmAt/m8 6EqZ0NIN9qa8e6nACgXzw/NKcAeampUOSrDurnv9q4cqcGKlEs80EHMnBSSwiJvX2UuK XiJ2SJyi+/3n6dVI6/VuraJ1L6BgF7NtD0rxmRnEpDkVsWq4YJmCB9id7ogYpmMRfmpR yyuQMT5G/xWUrxcVcBszvrgjILYHhgYxvv2suyrYNhAVU3Xs5fL17pv1BfNhrEJ4Ebe8 UpqQ== 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:arc-authentication-results; bh=DxXA8WSD2014CD9S6xrJZiecLOfXtgbdE0rms8Ocnlc=; b=vkCgVgoDwGOMtNpxqL/guc6NfsP/kbH8C857h53ZfhHclA8tllPNt3g+0EQ9ZUn0/w Cn9G+2AucDZEJCtRwCXnPsRnHt0D6NCCPw+ANWp5EJ//VSrHJ5Q2ZpYXAsnLjuxH5LzN qU2sZjrmJxFN2V/nYQMzGgbsnfeAm31OnoQNeYQwao76oQbl1nbfSw0LTtQrbTGTeoS1 jnrDFUk5JmtC1BlCjDw1IHttpCtVSAYo63f0zG6/sEkJrNJk3KItXMZFdv/goX3eTiiN NVGxCSB+2dFHOHHeAH31anJXBqd9OwM3Mz901uSpzCVSsjfabz/jchkjGam9W9vLCXHU aIXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k3Tt75kz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x24-v6si1600661pfk.311.2018.05.15.20.11.15; Tue, 15 May 2018 20:11:42 -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=pass header.i=@kernel.org header.s=default header.b=k3Tt75kz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752338AbeEPDLF (ORCPT + 99 others); Tue, 15 May 2018 23:11:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:57636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038AbeEPDLE (ORCPT ); Tue, 15 May 2018 23:11:04 -0400 Received: from localhost (LFbn-NCY-1-193-82.w83-194.abo.wanadoo.fr [83.194.41.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67ADC20652; Wed, 16 May 2018 03:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526440264; bh=YlR0CgAX2YZbujke0g7snVMl3XjyVM4zv7M2gHPNb80=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k3Tt75kzgS9fQAxNIOxgb8BJNQZpYu0gRLIU+Yp6/Nn3t4oC3BNl5FwdatVGu8NsM J2jXYhTso0U2Xrbdy3Fnk7+YIBkGBCvMaJ3c37TDkR/QnfAIoEVozvayqDj2TJ9uqF LiOBia1mf6RmeaYxSKUDL29yKnms+l1R86s/sTqo= Date: Wed, 16 May 2018 05:11:01 +0200 From: Frederic Weisbecker To: Peter Zijlstra Cc: LKML , Jiri Olsa , Namhyung Kim , Linus Torvalds , Yoshinori Sato , Benjamin Herrenschmidt , Catalin Marinas , Chris Zankel , Paul Mackerras , Thomas Gleixner , Will Deacon , Michael Ellerman , Rich Felker , Ingo Molnar , Mark Rutland , Alexander Shishkin , Andy Lutomirski , Arnaldo Carvalho de Melo , Max Filippov Subject: Re: [PATCH 8/9] perf/breakpoint: Split breakpoint "check" and "commit" Message-ID: <20180516031059.GA2271@lerouge> References: <1525634395-23380-1-git-send-email-frederic@kernel.org> <1525634395-23380-9-git-send-email-frederic@kernel.org> <20180509091703.GH12217@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180509091703.GH12217@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 09, 2018 at 11:17:03AM +0200, Peter Zijlstra wrote: > On Sun, May 06, 2018 at 09:19:54PM +0200, Frederic Weisbecker wrote: > > arch/arm/include/asm/hw_breakpoint.h | 5 ++++- > > arch/arm/kernel/hw_breakpoint.c | 22 +++------------------- > > arch/arm64/include/asm/hw_breakpoint.h | 5 ++++- > > arch/arm64/kernel/hw_breakpoint.c | 22 +++------------------- > > arch/powerpc/include/asm/hw_breakpoint.h | 5 ++++- > > arch/powerpc/kernel/hw_breakpoint.c | 22 +++------------------- > > arch/sh/include/asm/hw_breakpoint.h | 5 ++++- > > arch/sh/kernel/hw_breakpoint.c | 22 +++------------------- > > arch/x86/include/asm/hw_breakpoint.h | 5 ++++- > > arch/x86/kernel/hw_breakpoint.c | 23 +++-------------------- > > arch/xtensa/include/asm/hw_breakpoint.h | 5 ++++- > > arch/xtensa/kernel/hw_breakpoint.c | 22 +++------------------- > > Because of those ^, > > > kernel/events/hw_breakpoint.c | 11 ++++++----- > > would it not make sense to have a prelimenary patch doing something > like: > > __weak int hw_breakpoint_arch_check(struct perf_event *bp) > { > return arch_validate_hwbkpt_settings(bp); > } So eventually I fear I can't do that, due to linking order. Say I convert x86 to implement hw_breakpoint_arch_check(), so I remove arch_validate_hwbkpt_settings(). On build time, the weak version is still compiled and can't find a declaration for arch_validate_hwbkpt_settings(). I tried to keep the declaration while the definition has been removed but it seems the weak version is linked first before it gets later replaced by the overriden arch version. So I get a build error. I could keep arch_validate_hwbkpt_settings() around on all archs and remove it in the end with the weak version but that would defeat the purpose of removing the mid-state in the current patch.