Kernel KVM-PPC virtualization development
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH] powerpc: Disable DAWR on POWER9
Date: Mon, 19 Mar 2018 04:30:08 +0000	[thread overview]
Message-ID: <1521433808.30270.26.camel@neuling.org> (raw)
In-Reply-To: <20180316025456.24036-1-mikey@neuling.org>

On Fri, 2018-03-16 at 17:53 -0300, Pedro Franco de Carvalho wrote:
> Michael Neuling <mikey@neuling.org> writes:
> 
> > For ptrace, we now return an error if run on a POWER9. GDB gives this
> > error when you attempt to run a program with a breakpoint set on
> > POWER9:
> >   "Unexpected error setting breakpoint or watchpoint: No such device."
> 
> Thanks a lot for implementing this!
> 
> Would it also make sense to have PPC_PTRACE_GETHWDBGINFO return
> dbginfo.num_data_bps = 0 if !breakpoint_available()? In this case GDB
> would work in a friendlier way, because it would transparently switch to
> software watchpoints.

If I do that, it looks like GDB falls back to software emulation (very sloooow)
of the watchpoint rather than failing with the error I gave before. 

That's probably the better solution, so I'll do that... Thanks!

> Not sure what to do about .features in this case. I assume currently it
> only has PPC_DEBUG_FEATURE_DATA_BP_RANGE set and not the DAWR feature
> flag (since the cpu feature is disabled).

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.

Thanks for the catch.

Mikey

      parent reply	other threads:[~2018-03-19  4:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16  2:54 [PATCH] powerpc: Disable DAWR on POWER9 Michael Neuling
2018-03-16  3:43 ` Nicholas Piggin
2018-03-16  5:26 ` Michael Neuling
2018-03-16  7:17 ` Nicholas Piggin
2018-03-16 20:53 ` Pedro Franco de Carvalho
2018-03-19  4:30 ` Michael Neuling [this message]

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=1521433808.30270.26.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