[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 07/11] xen/arm: bitops: Implement a ffsll function


  • To: Julien Grall <julien@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Mon, 18 Jan 2021 15:32:50 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C9IV17zDZ3uWL9C1HTgT5oVAx4b3rKnMV9VVqEWS0l8=; b=WwScBb1q8xpL1DieaO+u9SfxoYKpDsmGaObURKfjc7+u+fKaxfez2smu4Rb3f9fFbt5A2oPQ9i5uASzqR9kx+h2I2SAbXn0YS4NNUSXnu9cOuIrIyGXD6lnTe5xWS/Gvn2BR1lymLfs40Wxwh73eXfWNFUNKSQ+L7ZtrX2F2wV80hrDP14bfKuSC5+jHeEKg64LhuLHjjw+hMgIXl6uF/gY/5t0n4l+wq1JhH1Hh8IxpoVrmqDO40/PC5esFQtU9KnjM/se01Vuw7DnlvEUNjRxAagQWfw11SiqNUVlXTGBB3To3Y1Cc3cA92/RGFpbrPKkKC5wVW5VpgGayYU3KfQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NM3GDaKYbJMwqIo59d9ctt1BbmOvvpCUTP6NSJtTZIMDR54kKLnkL2sNkFLVX64zrtDBGxJ7wuh0/qrwoP+sMZk3Gnrybry9yoO2WT5M8r2kHxWrao1dQT/+cLxsVW/UzFMNVA4YKIhKaBRkUb2d1Bh14+9TLMex0J/GCJTvqka5m+GrsaNRbUBdzuRqSOM2oXdXrtWLooT0k3VdqOI0w84RvCvZtlp9lgiUvvxFWTMuToeJkCe9HAaTcqXFJ5gB3UhAABcwoiMZbEZWuo4sbTwJGhgaF8yn8chmkUOxqchbrfbUnFL6/bKLWuW3L+tFS48D/3QZir7FKwla+jNJVw==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 18 Jan 2021 15:33:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHW5c2vjMAKQ6hzhEO4om3zctrksqoopM6AgATt8YA=
  • Thread-topic: [PATCH v4 07/11] xen/arm: bitops: Implement a ffsll function

Hello Julien,

> On 15 Jan 2021, at 12:16 pm, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Rahul,
> 
> On 08/01/2021 14:46, Rahul Singh wrote:
>> Implement the ffsll based on built-in function "__builtin_ffsll()"
>> ffsll will return one plus the index of the least significant 1-bit in
>> doublewords or if doublewords is zero, returns zero.
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>> ---
>> Changes in V4:
>>  - This patch is introduce in this verison.
>> ---
>>  xen/include/asm-arm/bitops.h | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>> diff --git a/xen/include/asm-arm/bitops.h b/xen/include/asm-arm/bitops.h
>> index 71ae14cab3..7f83ee1828 100644
>> --- a/xen/include/asm-arm/bitops.h
>> +++ b/xen/include/asm-arm/bitops.h
>> @@ -170,6 +170,18 @@ static inline unsigned int find_first_set_bit(unsigned 
>> long word)
>>          return ffsl(word) - 1;
>>  }
>>  +/**
>> + * ffsll - find the first least significant set bit
>> + * @doubleword: double word to search
>> + *
>> + * Returns one plus the index of the least significant 1-bit in @doubleword
>> + * or if doubleword is zero, returns zero.
>> + */
>> +static inline int ffsll(long long doubleword)
> 
> If I am not mistaken, we already have an helper doing exactly the same (see 
> ffs64() in xen/bitops.h).
> 
> Can you check if it is effectively the case and use it?

I checked we can use the ffs64() for SMMUv3 driver as it is doing exactly the 
same as ffsll().
I will modify the code to use the ffs64() in place of ffsll().

Regards,
Rahul
> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.