Skip to content

AArch64: KGDB support

Will Deacon linux-arm-kernel 7 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest posting 3/30 of 3 patches 0 repliesNew
  2. v6 posting 2/30 of 3 patches 0 repliesSuperseded
  3. v6 posting 1/31 of 3 patches 0 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v44 patches0 repliesSuperseded
v33 of 4 patches0 repliesSuperseded
v23 patches0 repliesSuperseded
v1 RFC2 patches0 repliesSuperseded

Patches in v6 posting 3/3 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 0/3] AArch64: KGDB support
Quoted 18 lines · Vijay Kilari
Quoted 5 lines · Vijay Kilari
Quoted 5 lines
Quoted 1 line · Will Deacon

That's a good point: I think we wait until our first exception before they are unmasked. Perhaps we should:

(1) Move local_dbg_{save,restore} from debug-monitors.h into irqflags.h

local_dbg_save is setting bit #8 it should be bit #9?

#define local_dbg_save(flags)
         \
        do {
         \
                typecheck(unsigned long, flags);
         \
                asm volatile(
         \
                "mrs    %0, daif                        //
Quoted 2 lines

local_dbg_save\n" \
"msr daifset, #8"

That uses daifset, so #8 is bit 3 which is D.

Quoted 19 lines
Quoted 19 lines
Quoted 5 lines

(2) Add local_dbg_enable/local_dbg_disable macros
(3) Add a call to local_dbg_enable in the clear_os_lock function after the

     isb().

Does that work for you?

Yes, only after first exception occurs the PSTATE.D is unmasked.

I have patched (temp) as below and now KGDB boot tests pass

arch/arm64/include/asm/debug-monitors.h +0 -0
index aff3a76..ea2bc46 100644
@@ -64,6 +111,24 @@ struct task_struct;
 
 #define DBG_ARCH_ID_RESERVED   0       /* In case of ptrace ABI updates. */
 
Quoted 7 lines

arch/arm64/include/asm/debug-monitors.h struct task_struct; · line 120

Quoted 7 lines
arch/arm64/include/asm/debug-monitors.h +4 -0
+#define local_dbg_enable()
         \
+       do {
         \
+               asm volatile(
         \
+               "msr    daifclr, #9             //

I think this is going to unmask fiq as well...

Will