Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753223AbdLEXiW (ORCPT ); Tue, 5 Dec 2017 18:38:22 -0500 Received: from ale.deltatee.com ([207.54.116.67]:54324 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752974AbdLEXiV (ORCPT ); Tue, 5 Dec 2017 18:38:21 -0500 To: Serge Semin , jdmason@kudzu.us, dave.jiang@intel.com, Allen.Hubbe@emc.com, Shyam-sundar.S-k@amd.com, Xiangliang.Yu@amd.com, gary.hook@amd.com Cc: linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org References: <20171203191736.3399-1-fancer.lancer@gmail.com> <20171205223918.28727-1-fancer.lancer@gmail.com> <20171205223918.28727-4-fancer.lancer@gmail.com> From: Logan Gunthorpe Message-ID: <26ca1ce6-c4b9-818f-7b12-994bf8ae7e50@deltatee.com> Date: Tue, 5 Dec 2017 16:38:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171205223918.28727-4-fancer.lancer@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-ntb@googlegroups.com, gary.hook@amd.com, Xiangliang.Yu@amd.com, Shyam-sundar.S-k@amd.com, Allen.Hubbe@emc.com, dave.jiang@intel.com, jdmason@kudzu.us, fancer.lancer@gmail.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH v3 03/15] NTB: Fix UB/bug in ntb_mw_get_align() X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 635 Lines: 16 On 05/12/17 03:39 PM, Serge Semin wrote: > Simple (1 << pidx) operation causes undefined behaviour when > pidx >= 32. It must be casted to u64 to match the actual return > value of ntb_link_is_up() method, so to have all the possible > peer indexes covered and to get rid of undefined behaviour. > Additionally there are special macros in "linux/bitops.h" to perform > the bit-set-shift operations, so it's recommended to have them used > for proper bit setting. > > Signed-off-by: Serge Semin Looks like you dropped my reviewed by tag for some reason. Reviewed-by: Logan Gunthorpe