From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4234C433F5 for ; Mon, 27 Sep 2021 11:49:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E24460F6C for ; Mon, 27 Sep 2021 11:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234049AbhI0LvJ (ORCPT ); Mon, 27 Sep 2021 07:51:09 -0400 Received: from verein.lst.de ([213.95.11.211]:46375 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233983AbhI0LvI (ORCPT ); Mon, 27 Sep 2021 07:51:08 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id A297167373; Mon, 27 Sep 2021 13:49:28 +0200 (CEST) Date: Mon, 27 Sep 2021 13:49:28 +0200 From: Christoph Hellwig To: Alex Williamson Cc: Jason Gunthorpe , Christoph Hellwig , Diana Craciun , Cornelia Huck , Kirti Wankhede , Eric Auger , Terrence Xu , kvm@vger.kernel.org Subject: Re: [PATCH 13/15] vfio/iommu_type1: initialize pgsize_bitmap in ->open Message-ID: <20210927114928.GA23909@lst.de> References: <20210924155705.4258-1-hch@lst.de> <20210924155705.4258-14-hch@lst.de> <20210924174852.GZ3544071@ziepe.ca> <20210924123755.76041ee0.alex.williamson@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210924123755.76041ee0.alex.williamson@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Sep 24, 2021 at 12:37:55PM -0600, Alex Williamson wrote: > > > + iommu->pgsize_bitmap = ULONG_MAX; > > > > I wonder if this needs the PAGE_MASK/SIZE stuff? > > > > iommu->pgsize_bitmap = ULONG_MASK & PAGE_MASK; > > > > ? > > > > vfio_update_pgsize_bitmap() goes to some trouble to avoid setting bits > > below the CPU page size here > > Yep, though PAGE_MASK should already be UL, so just PAGE_MASK itself > should work. The ULONG_MAX in the update function just allows us to > detect sub-page, ex. if the IOMMU supports 2K we can expose 4K minimum, > but we can't if the min IOMMU page is 64K. Thanks, Do you just want to update this or do you want a full resend of the series?