Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3407138ybi; Mon, 17 Jun 2019 23:51:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJPVxdDv+bZKxAFYPl+HISfg5XP/yRUl0sdULG6908WRCssaS9JwqVwhUpwMvV777Pgjfl X-Received: by 2002:a65:5347:: with SMTP id w7mr1231656pgr.375.1560840683664; Mon, 17 Jun 2019 23:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560840683; cv=none; d=google.com; s=arc-20160816; b=UQ/UZzooaxxdU+jbcnRZMNalLiTcO23v/qA5gy3dFkloZ+t4DxcIi9diYh9ueNhGJa OsKgr9mo2n1JhY086hbojcQDkNkcUMJnKJb+z+A4Lw+yohtqZa2IrFDG3m/uF3mFMmfm J1l7/9VxIUuA2AMV+AH3T98b9mDjrg+Z0yNVZXSxtDhpSBiD7uCCy+Mht7KdbQsQULs5 2/VfGAMfWQtMkyoSTnjaY+TYzpdXjwyoQwyVobkcSvcRGk1JjBqgU7ERJYQgfquKdF8o QcRDad43lFT3sDqETqMm44KRf7GpsSRr0/xbUr2LfH2/x4zyY58o8uG1m+Hy9F2NCDyT pnWw== 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=t8EkGCrHzuXsMOhfuoBqjBOp4EePACQOfRiTKQzo240=; b=Fu/qm8b+4rXvjkdC3dxCExjlUlsSPPAOCKnezlCUmV074KHpsBNH6ElNiGXyK4II9r UJQBYJr+2LUR83kL0Kjm7Ca2I7ZIFTX8kFNMVBXO6BW+EGIaE8MlgIiIOhLA/iGqp10E mwII2/lkoPvH9rcvL/v7rQmbLee0HUC3dNOyx6Rnh4EWbR12d+MG/R+22fH2VFeWOx6J ExIxWP872tHsswwHC8/QPHizhF4Lp93LXaboxBESLYqp3AhxfeV5ZoXpnjk4sQiRSI4e ry4F8OGInZzvsG1yPgxCCiXroVCrK82Z71c7j9TUbqbXGR78UiWfwMFa/d0GUn201DMu Gfag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=cFsBO9Zs; 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 16si12931749pgl.570.2019.06.17.23.51.08; Mon, 17 Jun 2019 23:51:23 -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=cFsBO9Zs; 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 S1728750AbfFRGuv (ORCPT + 99 others); Tue, 18 Jun 2019 02:50:51 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:7898 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbfFRGuo (ORCPT ); Tue, 18 Jun 2019 02:50:44 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 45SdNQ5LxPz9v2hq; Tue, 18 Jun 2019 08:24:54 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=cFsBO9Zs; 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 rONjPKrv_eoG; Tue, 18 Jun 2019 08:24:54 +0200 (CEST) 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 45SdNQ4J7Tz9v2hp; Tue, 18 Jun 2019 08:24:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1560839094; bh=t8EkGCrHzuXsMOhfuoBqjBOp4EePACQOfRiTKQzo240=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=cFsBO9ZsKYA6Rxu22NwSnfmVa4rWolVMT4MyHRVXUn1cxkA0aVhlqdmv9QVHxiu32 Caam8qSl7zZ8sBIpLx3p3zs2JpEUNXUqhlWXVikc39OUEbtrjhcZJeijlHHaOUylYk ELYEzQ0F3erX2aXD4mYoICx28x5KH+hM2pjhnoCM= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 95EFD8B86D; Tue, 18 Jun 2019 08:24:54 +0200 (CEST) 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 LCs9YYj1ow45; Tue, 18 Jun 2019 08:24:54 +0200 (CEST) Received: from PO15451 (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DC5E08B78B; Tue, 18 Jun 2019 08:24:53 +0200 (CEST) Subject: Re: [PATCH 3/5] Powerpc/hw-breakpoint: Refactor set_dawr() To: Ravi Bangoria , mpe@ellerman.id.au Cc: benh@kernel.crashing.org, paulus@samba.org, mikey@neuling.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, npiggin@gmail.com, naveen.n.rao@linux.vnet.ibm.com References: <20190618042732.5582-1-ravi.bangoria@linux.ibm.com> <20190618042732.5582-4-ravi.bangoria@linux.ibm.com> From: Christophe Leroy Message-ID: <36044d6d-d46f-8c7b-c597-0e5d156fd9db@c-s.fr> Date: Tue, 18 Jun 2019 08:24:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <20190618042732.5582-4-ravi.bangoria@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 18/06/2019 à 06:27, Ravi Bangoria a écrit : > Remove unnecessary comments. Code itself is self explanatory. > And, ISA already talks about MRD field. I Don't think we need > to re-describe it. In an RFC patch you may "don't think". But in the final patch you need to make a decision and write it as such. Ie, you should write: "We don't need to re-describe it." > > Signed-off-by: Ravi Bangoria > --- > arch/powerpc/kernel/process.c | 17 +++++------------ > 1 file changed, 5 insertions(+), 12 deletions(-) > > diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c > index f0fbbf6a6a1f..f002d2ffff86 100644 > --- a/arch/powerpc/kernel/process.c > +++ b/arch/powerpc/kernel/process.c > @@ -799,18 +799,11 @@ int set_dawr(struct arch_hw_breakpoint *brk) > > dawr = brk->address; > > - dawrx = (brk->type & (HW_BRK_TYPE_READ | HW_BRK_TYPE_WRITE)) \ > - << (63 - 58); //* read/write bits */ > - dawrx |= ((brk->type & (HW_BRK_TYPE_TRANSLATE)) >> 2) \ > - << (63 - 59); //* translate */ > - dawrx |= (brk->type & (HW_BRK_TYPE_PRIV_ALL)) \ > - >> 3; //* PRIM bits */ > - /* dawr length is stored in field MDR bits 48:53. Matches range in > - doublewords (64 bits) baised by -1 eg. 0b000000=1DW and > - 0b111111=64DW. > - brk->len is in bytes. > - This aligns up to double word size, shifts and does the bias. > - */ > + dawrx = (brk->type & HW_BRK_TYPE_RDWR) << (63 - 58); > + dawrx |= ((brk->type & HW_BRK_TYPE_TRANSLATE) >> 2) << (63 - 59); > + dawrx |= (brk->type & HW_BRK_TYPE_PRIV_ALL) >> 3; > + > + /* brk->len is in bytes. */ > mrd = ((brk->len + 7) >> 3) - 1; > dawrx |= (mrd & 0x3f) << (63 - 53); > >