Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp268309ybv; Sat, 22 Feb 2020 03:27:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxJS8mniZa5XNJklO2tRklp4664b+ujVYPSbEwJlOHAy3+trbF9NBqZe/pJY+Wv7weMWJm4 X-Received: by 2002:aca:4a84:: with SMTP id x126mr5486424oia.99.1582370861954; Sat, 22 Feb 2020 03:27:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582370861; cv=none; d=google.com; s=arc-20160816; b=aWCl/8j8DSnQn/EYWzBO/1WjLrBIoK9YcZzKc39Pdcbi90IEmrKnvXbYlynLx+h63b 5YKGSQM8l7irtBHOUYAqMjAv8VFHDKUokhyasYYiJnPd6v2dRi3EZDRF65iHiCy1mynl AG2e7mWq9KtcsGAh2RzqHKeoWkppxQv81uOPj599tsG8SIXdfXmTUzFGDHdPzn25gu7y rykLWeiF8h77/jB1h16H9SQqEpveupsZmIEZ7ktMV/99AOYZ5wC9HUic2RhcdjxQSrTY T92gbW73kkTB5yMshumldMoT/HlUD6g2dHlJ8KS0hHzpqnCKCQ2LYbA0LPMkHdHD8taT Lhjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=4iT5oLUTroPjIccYuns5zqLIPkL8k2A2IrBunY3qOp8=; b=AFNo7v9nfDFgKbSXzs194O31WXWyWJvuKEu5u9fI8b12J8nAtUQVNRrdXN69DnYkN5 LOSmL4b79N5mrUQVI2okQaxZivxd6yAI1GXPJXUkMSfU7U85XjgvCp2gHbfCiONI0Ste 7b4RTWcy/EPHbeK6xDvp5CiyaIqPQ4B+8aPYVdapIBMtMI6YhGVp4VFE5OO5LJwGX/w5 6gktHBE+XOmhrC2lmy3Bf6Coae6EfNZcpkhPcBOKamL/0hnmPo9Z9ezhiHUKQlrLNTVd +nzmL94awYcTeqJw0xFf4xu7RUUoifevWwABlp9BlOnZAYKRA7j8ZNOzXTVYexBGOQW1 9qBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=rH4W7axa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si3064615oto.205.2020.02.22.03.27.29; Sat, 22 Feb 2020 03:27:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=rH4W7axa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727207AbgBVL0i (ORCPT + 99 others); Sat, 22 Feb 2020 06:26:38 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:33579 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726726AbgBVL0i (ORCPT ); Sat, 22 Feb 2020 06:26:38 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48PmHZ5d62z9v6f3; Sat, 22 Feb 2020 12:26:34 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=rH4W7axa; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id eb4TsJikDmNu; Sat, 22 Feb 2020 12:26:34 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48PmHZ4MFYz9v6f2; Sat, 22 Feb 2020 12:26:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582370794; bh=4iT5oLUTroPjIccYuns5zqLIPkL8k2A2IrBunY3qOp8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=rH4W7axalzOcHBRnuymJNHQcPX24IdgR45ag0MClwMYM1QnYKLxX8JXans4uwc62Y pOk6CCVCQZK9hqUjvIH3VmP+1zRV2aQNkfas5G1nL2c8JU4VXDwLlfTlm49E16O+Aj psqVKvLwdf6RJfD0wBIJTSoApFY3r9u5nRz4KWYQ= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CE4FE8B762; Sat, 22 Feb 2020 12:26:35 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id UQprTtsWVdWK; Sat, 22 Feb 2020 12:26:35 +0100 (CET) Received: from pc16570vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 575228B755; Sat, 22 Feb 2020 12:26:35 +0100 (CET) Subject: Re: [PATCH] powerpc/watchpoint: Don't call dar_within_range() for Book3S To: Ravi Bangoria , mpe@ellerman.id.au Cc: mikey@neuling.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20200222082049.330435-1-ravi.bangoria@linux.ibm.com> From: Christophe Leroy Message-ID: Date: Sat, 22 Feb 2020 11:26:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20200222082049.330435-1-ravi.bangoria@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/22/2020 08:20 AM, Ravi Bangoria wrote: > DAR is set to the first byte of overlap between actual access and > watched range at DSI on Book3S processor. But actual access range > might or might not be within user asked range. So for Book3S, it > must not call dar_within_range(). > > This revert portion of commit 39413ae00967 ("powerpc/hw_breakpoints: > Rewrite 8xx breakpoints to allow any address range size."). > > Before patch: > # ./tools/testing/selftests/powerpc/ptrace/perf-hwbreak > ... > TESTED: No overlap > FAILED: Partial overlap: 0 != 2 > TESTED: Partial overlap > TESTED: No overlap > FAILED: Full overlap: 0 != 2 > failure: perf_hwbreak > > After patch: > TESTED: No overlap > TESTED: Partial overlap > TESTED: Partial overlap > TESTED: No overlap > TESTED: Full overlap > success: perf_hwbreak > > Fixes: 39413ae00967 ("powerpc/hw_breakpoints: Rewrite 8xx breakpoints to allow any address range size.") Oh, this seems to have been introduced by 27985b2a640e ("powerpc/watchpoint: Don't ignore extraneous exceptions blindly"). I must have lost it through a rebase as we were doing our series approximately at the same time, sorry for that. Reviewed-by: Christophe Leroy > Reported-by: Michael Ellerman > Signed-off-by: Ravi Bangoria > --- > arch/powerpc/kernel/hw_breakpoint.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c > index 2462cd7c565c..d0854320bb50 100644 > --- a/arch/powerpc/kernel/hw_breakpoint.c > +++ b/arch/powerpc/kernel/hw_breakpoint.c > @@ -331,11 +331,13 @@ int hw_breakpoint_handler(struct die_args *args) > } > > info->type &= ~HW_BRK_TYPE_EXTRANEOUS_IRQ; > - if (!dar_within_range(regs->dar, info)) > - info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ; > - > - if (!IS_ENABLED(CONFIG_PPC_8xx) && !stepping_handler(regs, bp, info)) > - goto out; > + if (IS_ENABLED(CONFIG_PPC_8xx)) { > + if (!dar_within_range(regs->dar, info)) > + info->type |= HW_BRK_TYPE_EXTRANEOUS_IRQ; > + } else { > + if (!stepping_handler(regs, bp, info)) > + goto out; > + } > > /* > * As a policy, the callback is invoked in a 'trigger-after-execute' >