Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1506546rwb; Mon, 7 Nov 2022 02:23:50 -0800 (PST) X-Google-Smtp-Source: AMsMyM45rKmW6+52d4h848FSGfmBNz6eL0dUo0h5B04AOoMB5LUYN1WpRBTEojf68ywOHNs+3DqQ X-Received: by 2002:a17:907:a0c9:b0:7ad:dc98:d9d2 with SMTP id hw9-20020a170907a0c900b007addc98d9d2mr36507403ejc.310.1667816630093; Mon, 07 Nov 2022 02:23:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667816630; cv=none; d=google.com; s=arc-20160816; b=Y0LfuuyeGX0jTva1YKtKYPUgVoF7q21aJdlEzhmQuk3MrWN2Oskxf+Hw4rcEogR4pa WNHjfOhXxKk3DTfA3wZrDSsC2VMHZjWIslmtEAxYG8APyvWCGmTcQoq0Uf/JHVvBJG/p nTGaB+YPHQMzVkoDLtXkO5jq6Iah5bGxz+RgIns6KXnKRAv1QiD1BZ5fpIcKnnN8DYHn Z6eRbgv+bTF8ed2cuDNg8l7NEJxwv1cCyLAED+eiavgbFTftBPNzxht32nT7kaTaBjEa BUHEpZNOlI9+OYddOhZqPQZ8ige+aSbo1foRGyvZ+fRFR4HhHWFIRojmojnM0cuRG5rf lUpw== 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 :message-id:date:subject:cc:to:from; bh=yA2fgEAANKYNgkm9LLBNaxIsYGxBGYEjvqlbfAkIfHc=; b=basC+eVZZKq70UgCYrSxcmhOyjrHOuwlSJ1y/tv/5Gswt9eOwnLgVr/YnDbpGA3utA XFzJ0NscPj1ltEHq/gk3RLXx4MxPodU3BIIjTZZMmZ9Y3R/5BTpw6A+X1bC7w0pZIa/T x3odjRt+3mmm/3o0ddR7b9nASvXaFZ3ofqE9g5XQOwgnXeLHBJrU1fqszwAM7iflD6sh n2ZnsGEr9VTmZwKtS3c/2rmpNjoGjFPumRPsHcMnv5uss5YhrRk6YXdmEZ3EQiP8Wk+1 sya4/pHblLVT9DA+OFHgVbkDVoUYlNV2P9WsCEWdv0udmbSYPZ+2dV9MBbtDljwppPlh U7Vg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a170906374900b007721f88d3e0si6703009ejc.554.2022.11.07.02.23.27; Mon, 07 Nov 2022 02:23:50 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231373AbiKGKNG (ORCPT + 94 others); Mon, 7 Nov 2022 05:13:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbiKGKNC (ORCPT ); Mon, 7 Nov 2022 05:13:02 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6285B2BC for ; Mon, 7 Nov 2022 02:13:00 -0800 (PST) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4N5Rm0032PzpW35; Mon, 7 Nov 2022 18:09:19 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemi500013.china.huawei.com (7.221.188.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 18:12:57 +0800 From: Changbin Du To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , CC: "H. Peter Anvin" , , , Changbin Du Subject: [PATCH] x86: use HW_BREAKPOINT_RW where possible Date: Tue, 8 Nov 2022 10:12:52 +0800 Message-ID: <20221108021252.605986-1-changbin.du@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.110.54.157] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500013.china.huawei.com (7.221.188.120) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_12_24, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Use enum HW_BREAKPOINT_RW where possible instead of individual (HW_BREAKPOINT_R | HW_BREAKPOINT_W). Signed-off-by: Changbin Du --- arch/x86/kernel/hw_breakpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index 668a4a6533d9..cccfb446ce80 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c @@ -213,7 +213,7 @@ int arch_bp_generic_fields(int x86_len, int x86_type, *gen_type = HW_BREAKPOINT_W; break; case X86_BREAKPOINT_RW: - *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; + *gen_type = HW_BREAKPOINT_RW; break; default: return -EINVAL; @@ -347,7 +347,7 @@ static int arch_build_bp_info(struct perf_event *bp, case HW_BREAKPOINT_W: hw->type = X86_BREAKPOINT_WRITE; break; - case HW_BREAKPOINT_W | HW_BREAKPOINT_R: + case HW_BREAKPOINT_RW: hw->type = X86_BREAKPOINT_RW; break; case HW_BREAKPOINT_X: -- 2.25.1