* [PATCH] x86/kgdb: return 0 from kgdb_arch_set_breakpoint
@ 2019-05-31 19:47 Matt Mullins
2019-05-31 19:51 ` Nadav Amit
2019-06-12 17:01 ` [tip:x86/urgent] x86/kgdb: Return 0 from kgdb_arch_set_breakpoint() tip-bot for Matt Mullins
0 siblings, 2 replies; 3+ messages in thread
From: Matt Mullins @ 2019-05-31 19:47 UTC (permalink / raw)
To: mmullins, bp, mingo, luto, namit, peterz
Cc: Thomas Gleixner, H. Peter Anvin, x86, Daniel Thompson,
Rick Edgecombe, Christophe Leroy, Douglas Anderson, linux-kernel
err must be nonzero in order to reach text_poke(), which caused kgdb to
fail to set breakpoints:
(gdb) break __x64_sys_sync
Breakpoint 1 at 0xffffffff81288910: file ../fs/sync.c, line 124.
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0xffffffff81288910
Command aborted.
Fixes: 86a22057127d ("x86/kgdb: Avoid redundant comparison of patched code")
Signed-off-by: Matt Mullins <mmullins@fb.com>
---
arch/x86/kernel/kgdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 9a8c1648fc9a..6690c5652aeb 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -758,7 +758,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
BREAK_INSTR_SIZE);
bpt->type = BP_POKE_BREAKPOINT;
- return err;
+ return 0;
}
int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/kgdb: return 0 from kgdb_arch_set_breakpoint
2019-05-31 19:47 [PATCH] x86/kgdb: return 0 from kgdb_arch_set_breakpoint Matt Mullins
@ 2019-05-31 19:51 ` Nadav Amit
2019-06-12 17:01 ` [tip:x86/urgent] x86/kgdb: Return 0 from kgdb_arch_set_breakpoint() tip-bot for Matt Mullins
1 sibling, 0 replies; 3+ messages in thread
From: Nadav Amit @ 2019-05-31 19:51 UTC (permalink / raw)
To: Matt Mullins
Cc: Borislav Petkov, mingo@redhat.com, luto@kernel.org,
peterz@infradead.org, Thomas Gleixner, H. Peter Anvin,
x86@kernel.org, Daniel Thompson, Rick Edgecombe, Christophe Leroy,
Douglas Anderson, linux-kernel@vger.kernel.org
> On May 31, 2019, at 12:47 PM, Matt Mullins <mmullins@fb.com> wrote:
>
> err must be nonzero in order to reach text_poke(), which caused kgdb to
> fail to set breakpoints:
>
> (gdb) break __x64_sys_sync
> Breakpoint 1 at 0xffffffff81288910: file ../fs/sync.c, line 124.
> (gdb) c
> Continuing.
> Warning:
> Cannot insert breakpoint 1.
> Cannot access memory at address 0xffffffff81288910
>
> Command aborted.
>
> Fixes: 86a22057127d ("x86/kgdb: Avoid redundant comparison of patched code")
> Signed-off-by: Matt Mullins <mmullins@fb.com>
> ---
> arch/x86/kernel/kgdb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
> index 9a8c1648fc9a..6690c5652aeb 100644
> --- a/arch/x86/kernel/kgdb.c
> +++ b/arch/x86/kernel/kgdb.c
> @@ -758,7 +758,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
> BREAK_INSTR_SIZE);
> bpt->type = BP_POKE_BREAKPOINT;
>
> - return err;
> + return 0;
> }
>
> int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
> --
> 2.17.1
My bad. Thanks for fixing it.
Reviewed-by: Nadav Amit <namit@vmware.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:x86/urgent] x86/kgdb: Return 0 from kgdb_arch_set_breakpoint()
2019-05-31 19:47 [PATCH] x86/kgdb: return 0 from kgdb_arch_set_breakpoint Matt Mullins
2019-05-31 19:51 ` Nadav Amit
@ 2019-06-12 17:01 ` tip-bot for Matt Mullins
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Matt Mullins @ 2019-06-12 17:01 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, gustavo, hpa, mingo, daniel.thompson,
christophe.leroy, x86, rick.p.edgecombe, bp, mingo, peterz, luto,
dianders, mmullins, tglx, namit
Commit-ID: 71ab8323cc357c68985a2d6fc6cfc22b1dbbc1c3
Gitweb: https://git.kernel.org/tip/71ab8323cc357c68985a2d6fc6cfc22b1dbbc1c3
Author: Matt Mullins <mmullins@fb.com>
AuthorDate: Fri, 31 May 2019 12:47:54 -0700
Committer: Borislav Petkov <bp@suse.de>
CommitDate: Wed, 12 Jun 2019 18:52:44 +0200
x86/kgdb: Return 0 from kgdb_arch_set_breakpoint()
err must be nonzero in order to reach text_poke(), which caused kgdb to
fail to set breakpoints:
(gdb) break __x64_sys_sync
Breakpoint 1 at 0xffffffff81288910: file ../fs/sync.c, line 124.
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0xffffffff81288910
Command aborted.
Fixes: 86a22057127d ("x86/kgdb: Avoid redundant comparison of patched code")
Signed-off-by: Matt Mullins <mmullins@fb.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Nadav Amit <namit@vmware.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190531194755.6320-1-mmullins@fb.com
---
arch/x86/kernel/kgdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 9a8c1648fc9a..6690c5652aeb 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -758,7 +758,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
BREAK_INSTR_SIZE);
bpt->type = BP_POKE_BREAKPOINT;
- return err;
+ return 0;
}
int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-12 17:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-31 19:47 [PATCH] x86/kgdb: return 0 from kgdb_arch_set_breakpoint Matt Mullins
2019-05-31 19:51 ` Nadav Amit
2019-06-12 17:01 ` [tip:x86/urgent] x86/kgdb: Return 0 from kgdb_arch_set_breakpoint() tip-bot for Matt Mullins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox