From: Michael Neuling <mikey@neuling.org>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH v2] powerpc: Disable DAWR on POWER9
Date: Thu, 22 Mar 2018 04:53:52 +0000 [thread overview]
Message-ID: <1521694432.19684.11.camel@neuling.org> (raw)
In-Reply-To: <20180320062224.10666-1-mikey@neuling.org>
On Tue, 2018-03-20 at 18:02 -0300, Pedro Franco de Carvalho wrote:
> I noticed that __set_breakpoint in process.c calls set_dabr if
> CPU_FTR_DAWR is not set. One case which could cause this to happen is if
> perf events are not configured (and CONFIG_HW_BREAKPOINT is not set),
> and someone calls ptrace with SET_DEBUGREG and data with a non-zero
> address and 0 in the RDWR bits. In this case set_bp will be false,
> thread.hw_brk will be set, and __switch_to will call __set_breakpoint,
> which will call set_dabr. I'm not sure what happens if mtspr with DARN
> is called on a P8.
This last sentence should read "I'm not sure what happens if mtspr with DABR is
called on a P9.", right?
If so, then it should be a nop, but we should fix it to make it clearer in the
code.
> > Yeah, currently you'll get PPC_DEBUG_FEATURE_DATA_BP_RANGE and no
> > PPC_DEBUG_FEATURE_DATA_BP_DAWR.
> >
> > If I set .features = 0 when !breakpoint_enabled() (as well as setting
> > num_data_bps = 0 above), GDB seems to not like it when I run the program on
> > P9:
> >
> > (gdb) r
> > Starting program: /bin/true
> > Warning:
> > Could not insert hardware watchpoint 1.
> > Could not insert hardware breakpoints:
> > You may have requested too many hardware breakpoints/watchpoints.
> > (gdb)
> >
> > So I think I'll leave this bits as I had in version 1 of the patch.
>
> This would make existing GDB releases work nicely, but it should
> probably be fixed in GDB.
>
> When .features is 0, GDB ignores the rest of the info returned by
> GETHWDBGINFO and assumes there will be at least one watchpoint register,
> which leads to the behavior you described, and doesn't seem correct
> (on the GDB side).
Yeah, agreed
Mikey
next prev parent reply other threads:[~2018-03-22 4:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-20 6:22 [PATCH v2] powerpc: Disable DAWR on POWER9 Michael Neuling
2018-03-20 21:02 ` Pedro Franco de Carvalho
2018-03-22 4:53 ` Michael Neuling [this message]
2018-03-22 12:35 ` Pedro Franco de Carvalho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521694432.19684.11.camel@neuling.org \
--to=mikey@neuling.org \
--cc=kvm-ppc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox