linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Stefaniuc <mstefani@redhat.com>
To: prasad@linux.vnet.ibm.com
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	linux-kernel@vger.kernel.org,
	Maneesh Soni <maneesh@linux.vnet.ibm.com>,
	Alexandre Julliard <julliard@winehq.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Maciej Rutecki <maciej.rutecki@gmail.com>,
	Roland McGrath <roland@redhat.com>
Subject: Re: Regression in ptrace (Wine) starting with 2.6.33-rc1
Date: Mon, 15 Feb 2010 20:37:31 +0100	[thread overview]
Message-ID: <4B79A27B.6080607@redhat.com> (raw)
In-Reply-To: <20100215115713.GA8907@in.ibm.com>

On 02/15/2010 12:57 PM, K.Prasad wrote:
> On Mon, Feb 15, 2010 at 12:05:16AM +0100, Michael Stefaniuc wrote:
>> On 02/14/2010 09:41 PM, Frederic Weisbecker wrote:
>>> On Sun, Feb 14, 2010 at 09:13:06PM +0100, Michael Stefaniuc wrote:
>>>> Although Wine will map address 0x0 for DOS programs that isn't the
>>>> reason for those tests. Wine has to support games that come with
>>>> pointless copy protection schemes that employ that technique.
>>> Ah, which kind of protection?
>> No clue as I'm not into games. But the wiki has a page for that
>> http://wiki.winehq.org/CopyProtection
>>
>>
>>>> Cool, thanks!
>>>> Any chance to get that fix into 2.6.33?
>>> Yeah.
>>>
>>> Could you please test the following patch on top of
>>> 2.6.33-rc9 ?
>> It is an improvement as I don't get an -EINVAL now but the data in DR7
>> is not what was written there and the test fails with:
>> exception.c:612: Test failed: failed to set debugregister 7 to 0x155,
>> got 2aa
>>
>
> Okay, so this 0x155 written onto ptrace got converted into 0x2AA -
> basically all requests to 'locally' enable breakpoints in DR0-DR3 (bits
> 0, 2, 4 and 6 of DR7) was converted into a request to 'globally' enable
> (bits 1, 3, 5 and 7) breakpoints.
Ok, so we have two regressions here:
- One fixed by Frederic where breakpoints at address 0x0 weren't allowed 
(Frederic, can you please upstream that fix?).
- The other one with 'locally'/'globally' enabled breakpoints.

> 'Local' breakpoints - here would mean those breakpoints pertaining to a
> process that are "automatically cleared on every task switch", which I
> presume, happen in cases where TSS registers are used for context
> switches (and as I learn is not the case with Linux).
>
> The hw-breakpoint infrastructure in Linux currently implements
> per-process breakpoints using 'global' flag but performs the clean-up
> after a task-switch using other methods (such as scheduler hooks through
> perf-events). All breakpoint requests (kernel or per-process)
> is treated as 'global'.
>
> We could change this to become 'local' for every local request (but still
> cleanup the breakpoints using scheduler hooks like the way we presently
> do), but I think this is an implementation detail and that a ptrace user
> need not worry about it. Or do you believe that there's any?
>
> I'm afraid I don't understand your motivation for these read/write tests
> on debug control register? Such tests, as in this case, cause unnecessary
Like Alexandre said that functionality is used by copy protection 
mechanisms.

> panic due to changes in an implementation detail internal to the kernel
> without any perceptible difference in functionality.
The behavior change is user visible and thus part of the ABI and not 
just an implementation detail.

thanks
bye
	michael

  parent reply	other threads:[~2010-02-15 19:37 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-11 16:33 Regression in ptrace (Wine) starting with 2.6.33-rc1 Michael Stefaniuc
2010-02-11 18:22 ` Frederic Weisbecker
2010-02-11 19:49   ` Michael Stefaniuc
2010-02-12 18:15     ` Frederic Weisbecker
2010-02-13 17:33     ` K.Prasad
2010-02-13 21:29       ` Michael Stefaniuc
2010-02-14 17:15         ` Frederic Weisbecker
2010-02-14 20:13           ` Michael Stefaniuc
2010-02-14 20:41             ` Frederic Weisbecker
2010-02-14 23:05               ` Michael Stefaniuc
2010-02-15 11:57                 ` K.Prasad
2010-02-15 15:57                   ` Alexandre Julliard
2010-02-15 19:37                   ` Michael Stefaniuc [this message]
2010-02-15 19:47                     ` Roland McGrath
2010-02-17 16:03                       ` Frederic Weisbecker
2010-02-17 17:06                 ` Frederic Weisbecker
2010-02-18 17:59                 ` Regression in ptrace (Wine) starting with 2.6.33-rc1, fixes Frederic Weisbecker
2010-02-18 19:27                   ` Michael Stefaniuc
2010-02-18 19:41                     ` Alexandre Julliard
2010-02-19 17:19                       ` Frederic Weisbecker
2010-02-19 17:17                     ` Frederic Weisbecker
2010-02-18 18:00                 ` [PATCH 1/2] hw-breakpoints: Accept breakpoints on NULL address Frederic Weisbecker
2010-02-18 21:16                   ` Roland McGrath
2010-02-19 17:38                     ` Frederic Weisbecker
2010-02-19  8:51                   ` K.Prasad
2010-02-18 18:00                 ` [PATCH 2/2] hw-breakpoint: Keep track of dr7 local enable bits Frederic Weisbecker
2010-02-19  8:45                   ` K.Prasad
2010-02-19 15:34                     ` Frederic Weisbecker
2010-02-19 17:58                       ` K.Prasad
2010-02-19 18:03                         ` Frederic Weisbecker
2010-02-19  8:58                   ` K.Prasad
2010-02-19 15:49                     ` Frederic Weisbecker
2010-02-19 17:41                     ` Frederic Weisbecker
2010-02-19 18:04                       ` K.Prasad
2010-02-19 18:12                         ` [GIT PULL] hw-breakpoint regression fixes Frederic Weisbecker
2010-02-22  9:56                           ` Ingo Molnar
2010-02-19 18:12                         ` [PATCH 1/2] hw-breakpoints: Accept breakpoints on NULL address Frederic Weisbecker
2010-02-19 18:12                         ` [PATCH 2/2] hw-breakpoint: Keep track of dr7 local enable bits Frederic Weisbecker

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=4B79A27B.6080607@redhat.com \
    --to=mstefani@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=julliard@winehq.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.rutecki@gmail.com \
    --cc=maneesh@linux.vnet.ibm.com \
    --cc=prasad@linux.vnet.ibm.com \
    --cc=rjw@sisk.pl \
    --cc=roland@redhat.com \
    --cc=stern@rowland.harvard.edu \
    /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).