From patchwork Fri Mar 10 16:07:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 67539 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp972222wrd; Fri, 10 Mar 2023 08:36:37 -0800 (PST) X-Google-Smtp-Source: AK7set95tFp9MMXc16NpeW430A3YZHDDryjNtGZdZzTrNwhI5GuM2fmeVPTX9fYixrBfHulPJ0Fx X-Received: by 2002:a17:902:9a03:b0:19c:d505:cdba with SMTP id v3-20020a1709029a0300b0019cd505cdbamr22153217plp.62.1678466197507; Fri, 10 Mar 2023 08:36:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678466197; cv=none; d=google.com; s=arc-20160816; b=sP/f/tojHO++0zsDGnxJW/2Xk7Z9WDXJ8pFvpchR/Y52agzdKP+Spv92zT2c3JRbHR s2Of1RoWQbyA31W5ORUP+zPCYcMhUIpV0EVELqYbb1LdFOx/1BlIXJikVHLNwcFfQoaJ KLMhySoms5VbvGpX/844WHnZ53ibJDGoS3cd6Abmlk9l7N+AfPkL1FdpUr2OWKd1oTM8 /gSW91yDte8Ln9sIUQ1JjvTRWmFVKZ1TmZBDXJKGtp+8DEYD+410ZmdLs6jVgN31XLWT l5AWJYJ9gDnP3quEepCP8WqXoHHVAQRcBnNtVGeghuiXkoeEuWMNF9y0ixsuKG1kWO+s GugA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6woSO0hLQ5AOX8ml8J8Kv2DAmsiAIUA/7xq1WhwbYPM=; b=oydYHjlP/memPnXSCYNd23Nw3PK4FYUKh3t7d0JYPMEzLLfJWgg/QfCi9SYERTgyDH oBiUBSXaW8J1KV9YAziWJHmLrbSj//F3VDPXeJbNnwVFDETeqNyUTDDB7IoH4waWfQEK h/ni37K4lqho+YJxjo+jvCQkKYDZ0TBmNI0PKjl7ze7Q7EHbRe4aflKloSwrk5jVridb vtPmQjX91nP2vAIgbAfpkYVCM+g0I1hGiiJOAu2TGNmBaRnS14SBEUp3xG76Qhb4Y3jr AgOgOIil5o0suwLjt5PPZ3pbAKQJqoRfhwqL1HERppOaY0QXSferm8pOXpwHIg4MT+67 vspg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B9ai03vc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v6-20020a1709029a0600b0019ccdd9d745si331974plp.17.2023.03.10.08.36.25; Fri, 10 Mar 2023 08:36:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B9ai03vc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231517AbjCJQNw (ORCPT + 99 others); Fri, 10 Mar 2023 11:13:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231590AbjCJQMY (ORCPT ); Fri, 10 Mar 2023 11:12:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBF59118808 for ; Fri, 10 Mar 2023 08:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6woSO0hLQ5AOX8ml8J8Kv2DAmsiAIUA/7xq1WhwbYPM=; b=B9ai03vccdA3Uj8Z4vu7j0aqdYs0yYruFN691C9K+t2WDqFdD4jkdfA9neHgs0WDoRfPtj FJSWBOkd77x9CmaHBI10+GK71UTK4k6uWpCPkb0eRHPMpipKFefBUvsJGqLjts2eK55r8R Zn2IbCWXmvVxa2wxnHckLVcmdrQeezA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-47-HSShDvcENL6mqIOrmek3JA-1; Fri, 10 Mar 2023 11:08:14 -0500 X-MC-Unique: HSShDvcENL6mqIOrmek3JA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A2559882824; Fri, 10 Mar 2023 16:08:08 +0000 (UTC) Received: from thuth.com (unknown [10.45.224.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6A5F492B00; Fri, 10 Mar 2023 16:08:06 +0000 (UTC) From: Thomas Huth To: linux-kernel@vger.kernel.org, Arnd Bergmann Cc: linux-arch@vger.kernel.org, Chas Williams <3chas3@gmail.com>, Palmer Dabbelt , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, Christoph Hellwig Subject: [PATCH v2 3/5] Move bp_type_idx to include/linux/hw_breakpoint.h Date: Fri, 10 Mar 2023 17:07:55 +0100 Message-Id: <20230310160757.199253-4-thuth@redhat.com> In-Reply-To: <20230310160757.199253-1-thuth@redhat.com> References: <20230310160757.199253-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759999371449945033?= X-GMAIL-MSGID: =?utf-8?q?1759999371449945033?= From: Palmer Dabbelt This has a "#ifdef CONFIG_*" that used to be exposed to userspace. The names in here are so generic that I don't think it's a good idea to expose them to userspace (or even the rest of the kernel). There are multiple in-kernel users, so it's been moved to a kernel header file. Signed-off-by: Palmer Dabbelt Reviewed-by: Andrew Waterman Reviewed-by: Albert Ou Message-Id: <1447119071-19392-10-git-send-email-palmer@dabbelt.com> [thuth: Remove it also from tools/include/uapi/linux/hw_breakpoint.h] Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: Thomas Huth --- include/linux/hw_breakpoint.h | 10 ++++++++++ include/uapi/linux/hw_breakpoint.h | 10 ---------- tools/include/uapi/linux/hw_breakpoint.h | 10 ---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index f319bd26b030..7fbb45911273 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h @@ -7,6 +7,16 @@ #ifdef CONFIG_HAVE_HW_BREAKPOINT +enum bp_type_idx { + TYPE_INST = 0, +#if defined(CONFIG_HAVE_MIXED_BREAKPOINTS_REGS) + TYPE_DATA = 0, +#else + TYPE_DATA = 1, +#endif + TYPE_MAX +}; + extern int __init init_hw_breakpoint(void); static inline void hw_breakpoint_init(struct perf_event_attr *attr) diff --git a/include/uapi/linux/hw_breakpoint.h b/include/uapi/linux/hw_breakpoint.h index 965e4d8606d8..1575d3ca6f0d 100644 --- a/include/uapi/linux/hw_breakpoint.h +++ b/include/uapi/linux/hw_breakpoint.h @@ -22,14 +22,4 @@ enum { HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, }; -enum bp_type_idx { - TYPE_INST = 0, -#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS - TYPE_DATA = 0, -#else - TYPE_DATA = 1, -#endif - TYPE_MAX -}; - #endif /* _UAPI_LINUX_HW_BREAKPOINT_H */ diff --git a/tools/include/uapi/linux/hw_breakpoint.h b/tools/include/uapi/linux/hw_breakpoint.h index 965e4d8606d8..1575d3ca6f0d 100644 --- a/tools/include/uapi/linux/hw_breakpoint.h +++ b/tools/include/uapi/linux/hw_breakpoint.h @@ -22,14 +22,4 @@ enum { HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, }; -enum bp_type_idx { - TYPE_INST = 0, -#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS - TYPE_DATA = 0, -#else - TYPE_DATA = 1, -#endif - TYPE_MAX -}; - #endif /* _UAPI_LINUX_HW_BREAKPOINT_H */