mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86: use HW_BREAKPOINT_RW where possible
@ 2022-11-08  2:12 Changbin Du
  0 siblings, 0 replies; only message in thread
From: Changbin Du @ 2022-11-08  2:12 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: H. Peter Anvin, linux-kernel, hw.huiwang, Changbin Du

Use enum HW_BREAKPOINT_RW where possible instead of individual
(HW_BREAKPOINT_R | HW_BREAKPOINT_W).

Signed-off-by: Changbin Du <changbin.du@huawei.com>
---
 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-07 10:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08  2:12 [PATCH] x86: use HW_BREAKPOINT_RW where possible Changbin Du

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®