linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: mikey@neuling.org, mpe@ellerman.id.au,
	Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, npiggin@gmail.com,
	paulus@samba.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3 2/3] Powerpc64/Watchpoint: Don't ignore extraneous exceptions
Date: Wed, 04 Sep 2019 20:12:34 +0530	[thread overview]
Message-ID: <1567608022.j44gajn34z.naveen@linux.ibm.com> (raw)
In-Reply-To: <20190710045445.31037-3-ravi.bangoria@linux.ibm.com>

Ravi Bangoria wrote:
> On Powerpc64, watchpoint match range is double-word granular. On
> a watchpoint hit, DAR is set to the first byte of overlap between
> actual access and watched range. And thus it's quite possible that
> DAR does not point inside user specified range. Ex, say user creates
> a watchpoint with address range 0x1004 to 0x1007. So hw would be
> configured to watch from 0x1000 to 0x1007. If there is a 4 byte
> access from 0x1002 to 0x1005, DAR will point to 0x1002 and thus
> interrupt handler considers it as extraneous, but it's actually not,
> because part of the access belongs to what user has asked. So, let
> kernel pass it on to user and let user decide what to do with it
> instead of silently ignoring it. The drawback is, it can generate
> false positive events.

I think you should do the additional validation here, instead of 
generating false positives. You should be able to read the instruction, 
run it through analyse_instr(), and then use OP_IS_LOAD_STORE() and 
GETSIZE() to understand the access range. This can be used to then 
perform a better match against what the user asked for.

- Naveen


  parent reply	other threads:[~2019-09-04 14:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10  4:54 [PATCH v3 0/3] Powerpc64/Watchpoint: Few important fixes Ravi Bangoria
2019-07-10  4:54 ` [PATCH v3 1/3] Powerpc64/Watchpoint: Fix length calculation for unaligned target Ravi Bangoria
2019-07-10  4:54 ` [PATCH v3 2/3] Powerpc64/Watchpoint: Don't ignore extraneous exceptions Ravi Bangoria
2019-07-10  6:27   ` Christophe Leroy
2019-07-10  6:38     ` Ravi Bangoria
2019-09-04 14:42   ` Naveen N. Rao [this message]
2019-09-05  3:56     ` Ravi Bangoria
2019-07-10  4:54 ` [PATCH v3 3/3] Powerpc64/Watchpoint: Rewrite ptrace-hwbreak.c selftest Ravi Bangoria
2019-08-28  6:14   ` Christophe Leroy
2019-09-04  9:10     ` Ravi Bangoria
2019-08-06  3:27 ` [PATCH v3 0/3] Powerpc64/Watchpoint: Few important fixes Ravi Bangoria

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=1567608022.j44gajn34z.naveen@linux.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.org \
    --cc=ravi.bangoria@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).