Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1679266ybb; Sat, 21 Mar 2020 03:38:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvCSHwecqgU04xZrWIyTEbDRdX5BEsg5BWskMuk5iHGzxbYJE0kMSnleDmW6Ql6s5RaLHji X-Received: by 2002:a05:6830:201a:: with SMTP id e26mr10973603otp.238.1584787110723; Sat, 21 Mar 2020 03:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584787110; cv=none; d=google.com; s=arc-20160816; b=p6Wu6tvOLLe+Kx9moDK1Ylx/uIea5ENPRn1zIiej9OC58YXw/nK/tyrlKnOoS5kkjh v3foem3tWkZi2Nf6Z27dDr4CIjK5fJl6AGtlEL0x46QwT19t0Jx01mZv7mW1y/eUhErT bV4QKicRIiYpKVMCEJynay+3xKhjakZKRqRYVQxBFykFhdP+M93RbfEg6SO1D0cB4A1y 0uMEGyyBzdo+iZJ4+n3dI3hn5lq4377HPz00WMTBby5rR0BHQsqN+FgqF8o+6CtEcxaP 1cZ9BAlZtQ6Qf8MQuQ89wtZtuHNaonP6Q8ixRUI7a3CLRYdjVnxQ8y5V2en6hsVxt5hG xmuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :dkim-signature; bh=8dNFekUvF26E/zA1FpkQASGFZrLQ7xw2bJ/GI3qh8iI=; b=eXx+A3J1Y1REe22YWklo+814iAC4VQtcBTufrjVNS3eNHBLCaGzSnNwUuyaAu32U/2 NSZ7Esx5wkVIOfz6tejEhsE6noxgj+/0pTBh/DC9W059SmHG05PPDD3oo9Nny6AmDLpn OvfGnkxKOEU8Sic8+KQCskxeB48gDcdg5+mfYQ9+zlvVRJkqs5wTEzC2VLgftAcLYNTy dAgmbpD1Ig0XBO9uP3CeJe3cy/9E5wYM5oV2jfKz6Abbu2CBfOcp/D1wOjYWxySGVyMM Ypw8F0+yaFuzuAu7wKWqVcbE5HHOIUYempw95/hsbRfA7ta2PwGi+4T86EZaOrXNgV2W NZBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=WvlWrorl; 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 m23si5142070ots.325.2020.03.21.03.38.19; Sat, 21 Mar 2020 03:38:30 -0700 (PDT) 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=WvlWrorl; 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 S1727962AbgCUKh1 (ORCPT + 99 others); Sat, 21 Mar 2020 06:37:27 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:30741 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726933AbgCUKh0 (ORCPT ); Sat, 21 Mar 2020 06:37:26 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48kxst1vZdz9v26c; Sat, 21 Mar 2020 11:37:22 +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=WvlWrorl; 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 dV6ZTpKe0rJh; Sat, 21 Mar 2020 11:37:22 +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 48kxst0j1Mz9v26D; Sat, 21 Mar 2020 11:37:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1584787042; bh=8dNFekUvF26E/zA1FpkQASGFZrLQ7xw2bJ/GI3qh8iI=; h=From:Subject:To:Cc:Date:From; b=WvlWrorlU+XIPJ9tLAHV0CI4dnTs9hnGB2sYjUE/W9bIQZm0jkCGnau6ejoiTRaOI K8z2yiyMCKYjCfC1WeeKP2R+WbqsWRQZpn28TyHpEVJFW3Gija9CgYT/spm3yitRig cmbjF4ciUZo8cez30CSI5SJgXJlhz1H/DYOEpwzE= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2571E8B774; Sat, 21 Mar 2020 11:37:18 +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 zOeJedXCgpaI; Sat, 21 Mar 2020 11:37:18 +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 8CC848B752; Sat, 21 Mar 2020 11:37:17 +0100 (CET) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 2B5BB655CB; Sat, 21 Mar 2020 10:37:17 +0000 (UTC) Message-Id: <5558d8c22ff0ed03cb5392798564dd203bd68501.1584787012.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH] powerpc/ptrace: Fix ptrace-hwbreak selftest failure To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sat, 21 Mar 2020 10:37:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pieces of commit c3f68b0478e7 ("powerpc/watchpoint: Fix ptrace code that muck around with address/len") disappeared with commit 53387e67d003 ("powerpc/ptrace: split out ADV_DEBUG_REGS related functions."). Restore them. Fixes: 53387e67d003 ("powerpc/ptrace: split out ADV_DEBUG_REGS related functions.") Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/ptrace-noadv.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/ptrace/ptrace-noadv.c b/arch/powerpc/kernel/ptrace/ptrace-noadv.c index cf05fadba0d5..d4170932acb4 100644 --- a/arch/powerpc/kernel/ptrace/ptrace-noadv.c +++ b/arch/powerpc/kernel/ptrace/ptrace-noadv.c @@ -153,7 +153,7 @@ long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_inf if ((unsigned long)bp_info->addr >= TASK_SIZE) return -EIO; - brk.address = bp_info->addr & ~7UL; + brk.address = bp_info->addr & ~HW_BREAKPOINT_ALIGN; brk.type = HW_BRK_TYPE_TRANSLATE; brk.len = DABR_MAX_LEN; if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ) @@ -161,10 +161,6 @@ long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_inf if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE) brk.type |= HW_BRK_TYPE_WRITE; #ifdef CONFIG_HAVE_HW_BREAKPOINT - /* - * Check if the request is for 'range' breakpoints. We can - * support it if range < 8 bytes. - */ if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE) len = bp_info->addr2 - bp_info->addr; else if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT) @@ -177,7 +173,7 @@ long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_inf /* Create a new breakpoint request if one doesn't exist already */ hw_breakpoint_init(&attr); - attr.bp_addr = (unsigned long)bp_info->addr & ~HW_BREAKPOINT_ALIGN; + attr.bp_addr = (unsigned long)bp_info->addr; attr.bp_len = len; arch_bp_generic_fields(brk.type, &attr.bp_type); -- 2.25.0